<?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('popular_routes', function (Blueprint $table) {
            $table->id();
            $table->foreignId('from_destination_id')->constrained('destinations')->cascadeOnDelete();
            $table->foreignId('to_destination_id')->constrained('destinations')->cascadeOnDelete();
            $table->text('description')->nullable();
            $table->text('mm_description')->nullable();
            $table->boolean('is_active')->default(true);
            $table->timestamps();

            $table->unique(['from_destination_id', 'to_destination_id']);
        });
    }

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