<?php

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

return new class extends Migration
{
    /**
     * VARCHAR(20) is too short for the 'completed_with_errors' ImportStatus
     * value (22 chars) — widen to match audit_logs.action's precedent of 30.
     */
    public function up(): void
    {
        DB::statement("ALTER TABLE import_jobs MODIFY status VARCHAR(30) NOT NULL DEFAULT 'pending'");
    }

    public function down(): void
    {
        DB::statement("ALTER TABLE import_jobs MODIFY status VARCHAR(20) NOT NULL DEFAULT 'pending'");
    }
};
