<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    public function up(): void
    {
        Schema::create('scraps', function (Blueprint $table) {
            $table->id();
            $table->foreignId('asset_id')->constrained()->onDelete('cascade');
            $table->string('reason')->nullable();
            $table->string('vendor')->nullable();
            $table->date('scrap_date')->nullable();
            $table->string('certificate_path')->nullable();
            $table->enum('status', ['Scrapped', 'Restored'])->default('Scrapped');
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('scraps');
    }
};
