<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('filter_keys', function (Blueprint $table) {
            $table->id();

            $table->unsignedBigInteger('filter_id')->index();

            $table->string('title');

            $table->timestamps();

            $table->foreign('filter_id')->references('id')->on('filters')->cascadeOnDelete();
        });
    }

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