<?php

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

return new class extends Migration
{
    public function up(): void
    {
        // Legacy status "approved" is now the final HR approval status.
        DB::table('leave_requests')
            ->where('status', 'approved')
            ->update(['status' => 'hr_approved']);
    }

    public function down(): void
    {
        DB::table('leave_requests')
            ->where('status', 'hr_approved')
            ->update(['status' => 'approved']);
    }
};

