<?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('document_templates', function (Blueprint $table) {
            $table->string('output_filename_pattern')->nullable()->after('file_size');
            $table->string('date_format')->nullable()->after('output_filename_pattern');
            $table->boolean('fail_on_unresolved')->default(true)->after('date_format');
        });
    }

    public function down(): void
    {
        Schema::table('document_templates', function (Blueprint $table) {
            $table->dropColumn(['output_filename_pattern', 'date_format', 'fail_on_unresolved']);
        });
    }
};
