<?php

declare(strict_types=1);

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('nova_card_templates', function (Blueprint $table): void {
            $table->id();
            $table->string('slug', 120)->unique();
            $table->string('name', 120);
            $table->text('description')->nullable();
            $table->string('preview_image')->nullable();
            $table->json('config_json');
            $table->json('supported_formats');
            $table->boolean('active')->default(true);
            $table->boolean('official')->default(true);
            $table->integer('order_num')->default(0);
            $table->timestamps();
            $table->softDeletes();
        });
    }

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