<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        // Update GRN status enum to include all required statuses
        DB::statement("ALTER TABLE good_received_notes MODIFY COLUMN status ENUM('draft', 'posted', 'awaiting_qc', 'accepted', 'rejected', 'partial') NOT NULL DEFAULT 'draft'");
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        // Revert to original status enum
        DB::statement("ALTER TABLE good_received_notes MODIFY COLUMN status ENUM('draft', 'posted') NOT NULL DEFAULT 'draft'");
    }
};
