<?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('pension_cases', function (Blueprint $table) {
            $table->enum('claim_type', ['bank', 'fscs', 'fos'])->after('client_id');
            $table->foreignId('status_id')->nullable()->constrained('statuses')->nullOnDelete()->after('claim_type');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('pension_cases', function (Blueprint $table) {
            $table->dropConstrainedForeignId('status_id');
            $table->dropColumn('claim_type');
        });
    }
};
