<?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('content_type_slug_histories', function (Blueprint $table): void {
            $table->id();
            $table->foreignId('content_type_id')->constrained('content_types')->cascadeOnDelete();
            $table->string('old_slug', 64)->unique();
            $table->timestamps();

            $table->index('content_type_id');
        });
    }

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