<?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('song_slides', function (Blueprint $table) {
            $table->id();
            $table->foreignId('song_group_id')->constrained()->cascadeOnDelete();
            $table->unsignedInteger('order');
            $table->text('text_content');
            $table->text('text_content_translated')->nullable();
            $table->text('notes')->nullable();
            $table->timestamps();

            $table->index('song_group_id');
            $table->unique(['song_group_id', 'order']);
        });
    }

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