<?php

/*
 * This file is part of Laravel Love.
 *
 * (c) Anton Komarev <anton@komarev.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

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::table('DummyTable', function (Blueprint $table) {
            $table->foreignId('DummyForeignColumn');

            $table
                ->foreign('DummyForeignColumn')
                ->references('DummyReferencedColumn')
                ->on('DummyReferencedTable');
        });
    }

    public function down(): void
    {
        Schema::table('DummyTable', function (Blueprint $table) {
            $table->dropForeign(['DummyForeignColumn']);
            $table->dropColumn('DummyForeignColumn');
        });
    }
};
