<?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('esign_field_templates', function (Blueprint $table) {
            $table->string('category', 50)->nullable()->after('description')->comment('템플릿 카테고리');
            $table->index('category', 'idx_esign_field_templates_category');
        });
    }

    public function down(): void
    {
        Schema::table('esign_field_templates', function (Blueprint $table) {
            $table->dropIndex('idx_esign_field_templates_category');
            $table->dropColumn('category');
        });
    }
};
