<?php

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

/**
 * Class UpdateMiestoKonaniaTerminyUdalostUdalostiTable
 */
return new class extends Migration {
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('terminy_udalost_udalosti', function (Blueprint $table) {
            $table
                ->unsignedBigInteger('miesto_konania_id')
                ->after('vytvoril_id');

            $table->dropColumn('miesto_konania');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('terminy_udalost_udalosti', function (Blueprint $table) {
            $table->longText('miesto_konania')->nullable();

            $table->dropColumn('miesto_konania_id');
        });
    }
};
