<?php

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

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

            $table->string('nazov');
            $table->string('druh');
            $table->string('stav');
            $table->string('registracia');
            $table->dateTime('datum_od')->nullable();
            $table->dateTime('datum_do')->nullable();
            $table->integer('kapacita')->default(1);
            $table->longText('miesto_konania')->nullable();
            $table->longText('popis')->nullable();

            $table->timestamps();
            $table->softDeletes();
        });
    }

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