<?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('interview_categories', function (Blueprint $table) {
            $table->unsignedBigInteger('interview_project_id')->nullable()
                ->after('tenant_id')->comment('프로젝트 연결');
            $table->string('domain', 50)->nullable()
                ->after('description')->comment('도메인 영역 태그');

            $table->index('interview_project_id', 'idx_interview_categories_project');
        });
    }

    public function down(): void
    {
        Schema::table('interview_categories', function (Blueprint $table) {
            $table->dropIndex('idx_interview_categories_project');
            $table->dropColumn(['interview_project_id', 'domain']);
        });
    }
};
