<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * Creates the gallery_types table to categorize galleries.
     * Allows organization of galleries by design, format, or purpose.
     *
     * @return void
     */
    public function up(): void
    {
        Schema::create('gallery_types', function (Blueprint $table) {
            // Primary key
            $table->id();

            // Gallery type details
            $table->string('name', 191);
            $table->text('description')->nullable();

            // Color/styling indicator
            $table->string('color', 50)->default('#3b82f6');

            // Icon for UI display
            $table->string('icon', 191)->default('fa-images');

            // Status
            $table->boolean('is_active')->default(true);

            // Timestamps and soft deletes
            $table->timestamps();
            $table->softDeletes();

            // Indexes for performance
            $table->index('name');
            $table->index('is_active');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down(): void
    {
        Schema::dropIfExists('gallery_types');
    }
};
