<?php

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

return new class extends Migration
{
    public function up(): void
    {
        DB::statement("ALTER TABLE users MODIFY role ENUM('admin','cashier','technician','courier') NOT NULL DEFAULT 'technician'");
    }

    public function down(): void
    {
        DB::statement("UPDATE users SET role = 'technician' WHERE role = 'cashier'");
        DB::statement("ALTER TABLE users MODIFY role ENUM('admin','technician','courier') NOT NULL DEFAULT 'technician'");
    }
};