<?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
{
    Schema::table('users', function (Blueprint $table) {
        // Drop the old enum and add a new one with the 'admin' role
        $table->enum('role', ['passenger', 'captain', 'admin'])->default('passenger')->change();
    });
}

public function down(): void
{
    Schema::table('users', function (Blueprint $table) {
        // Revert the change
        $table->enum('role', ['passenger', 'captain'])->default('passenger')->change();
    });
}
};
