<?php

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

return new class extends Migration
{
    public function up(): void
    {
        DB::statement("
            ALTER TABLE loans
            MODIFY status ENUM(
                'pending',
                'approved',
                'rejected',
                'disbursed',
                'active',
                'completed',
                'overdue',
                'cancelled',
                'closed'
            ) NOT NULL DEFAULT 'pending'
        ");
    }

    public function down(): void
    {
        DB::statement("
            ALTER TABLE loans
            MODIFY status ENUM(
                'pending',
                'approved',
                'rejected',
                'disbursed',
                'active',
                'completed',
                'overdue',
                'cancelled'
            ) NOT NULL DEFAULT 'pending'
        ");
    }
};