<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        // Modify ENUM to include 'other' type
        DB::statement("ALTER TABLE offices MODIFY COLUMN type ENUM('headquarters', 'branch', 'bpkp', 'pemda', 'other') DEFAULT 'branch'");
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        // Remove 'other' from ENUM (only if no records use it)
        DB::statement("ALTER TABLE offices MODIFY COLUMN type ENUM('headquarters', 'branch', 'bpkp', 'pemda') DEFAULT 'branch'");
    }
};
