<?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('import_entities', function (Blueprint $table) {
            $table->string('handler_class')->nullable()->after('meta');
            $table->json('validation_rules')->nullable()->after('handler_class');
            $table->json('processing_options')->nullable()->after('validation_rules');
            $table->boolean('is_active')->default(true)->after('processing_options');
            $table->integer('priority')->default(0)->after('is_active');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('import_entities', function (Blueprint $table) {
            $table->dropColumn(['handler_class', 'validation_rules', 'processing_options', 'is_active', 'priority']);
        });
    }
};
