<?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('artworks', function (Blueprint $table): void {
            $table->timestamp('last_vector_indexed_at')->nullable()->after('vision_metadata_updated_at')->index();
        });
    }

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