<?php

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

return new class extends Migration
{
    public function up(): void
    {
        $driver = Schema::getConnection()->getDriverName();
        if ($driver === 'mysql') {
            DB::statement("ALTER TABLE admin_users MODIFY COLUMN role ENUM('super_admin', 'admin', 'service_admin') DEFAULT 'admin'");
        }
    }

    public function down(): void
    {
        $driver = Schema::getConnection()->getDriverName();
        if ($driver === 'mysql') {
            DB::statement("ALTER TABLE admin_users MODIFY COLUMN role ENUM('super_admin', 'admin') DEFAULT 'admin'");
        }
    }
};
