<?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('file_path')->nullable()->after('category')->comment('PDF 파일 경로');
            $table->string('file_name')->nullable()->after('file_path')->comment('원본 파일명');
            $table->string('file_hash', 64)->nullable()->after('file_name')->comment('SHA256');
            $table->unsignedBigInteger('file_size')->nullable()->after('file_hash')->comment('바이트');
        });
    }

    public function down(): void
    {
        Schema::table('esign_field_templates', function (Blueprint $table) {
            $table->dropColumn(['file_path', 'file_name', 'file_hash', 'file_size']);
        });
    }
};
