<?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('device_presets', function (Blueprint $table) {
            $table->id();
            $table->string('key')->unique();
            $table->string('label');
            $table->string('platform', 16);
            $table->string('category', 16);
            $table->unsignedInteger('export_w');
            $table->unsignedInteger('export_h');
            $table->string('frame_svg_path')->nullable();
            $table->json('safe_area')->nullable();
            $table->boolean('is_active')->default(true);
            $table->timestamps();

            $table->index(['platform', 'category']);
        });
    }

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