<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Seka\Portal\Modul\Vzdelavanie\Enums\ModelStatusEnum;
use Illuminate\Database\Migrations\Migration;

/**
 * Class UpdateVzdelavanieTestovanieTestyTable
 */
return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up(): void
    {
        Schema::table('vzdelavanie_testovanie_testy', function (Blueprint $table) {
            $table->string('stav')
                ->default(ModelStatusEnum::NEPUBLIKOVANE)
                ->after('pocet_otazok');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down(): void
    {
        Schema::table('vzdelavanie_testovanie_testy', function (Blueprint $table) {
            $table->dropColumn('stav');
        });
    }
};
