<?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::create('document_template_field_presets', function (Blueprint $table) {
            $table->id();
            $table->string('name', 100)->comment('프리셋명 (수입검사 기본 필드 세트)');
            $table->string('category', 50)->nullable()->comment('연관 카테고리');
            $table->json('fields')->comment('section_fields 배열');
            $table->json('links')->nullable()->comment('template_links 배열');
            $table->unsignedSmallInteger('sort_order')->default(0);
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('document_template_field_presets');
    }
};
