<?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('archived_records', function (Blueprint $table) {
            $table->uuid('batch_id')->nullable()->after('id')->comment('일괄 작업 ID');
            $table->string('batch_description')->nullable()->after('batch_id')->comment('작업 요약 (예: 테넌트 ABC 삭제)');

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

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('archived_records', function (Blueprint $table) {
            $table->dropIndex(['batch_id']);
            $table->dropColumn(['batch_id', 'batch_description']);
        });
    }
};
