<?php
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::create('evaluaciones', function (Blueprint $table) {
            $table->id();
            $table->string('titulo');
            $table->text('descripcion')->nullable();
            $table->unsignedBigInteger('evaluacion_tipo_id');
            $table->enum('status', ['borrador', 'activa', 'cerrada'])->default('borrador');
            $table->date('fecha_inicio')->nullable();
            $table->date('fecha_fin')->nullable();
            $table->boolean('anonima')->default(false);
            $table->timestamps();
            $table->foreign('evaluacion_tipo_id')->references('id')->on('evaluacion_tipos');
        });
    }
    public function down(): void { Schema::dropIfExists('evaluaciones'); }
};
