<?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::table('bugs', function (Blueprint $table) {
            // Using change() to update the enum
            $table->string('status', 30)->default('open')->change();
        });
    }

    public function down(): void
    {
        Schema::table('bugs', function (Blueprint $table) {
            $table->enum('status', ['open', 'in_progress', 'resolved', 'qa_approved', 'qa_rejected', 'reopened', 'closed'])->default('open')->change();
        });
    }
};
