<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('route_articles', function (Blueprint $table) {
            $table->timestamp('decided_at')->nullable()->after('validated_at');

            $table->index('decided_at');
        });
    }

    public function down(): void
    {
        Schema::table('route_articles', function (Blueprint $table) {
            $table->dropIndex(['decided_at']);
            $table->dropColumn('decided_at');
        });
    }
};
