<?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('fases', function (Blueprint $table) {
            $table->id();
            $table->foreignId('project_id')->constrained('projects')->cascadeOnDelete();
            $table->enum('type', [
                'signaal',
                'verkenning',
                'concept',
                'experiment',
                'pilot',
                'besluitvorming',
                'overdracht_bouwen',
                'overdracht_beheer',
                'evaluatie',
            ]);
            $table->enum('status', ['open', 'actief', 'afgerond'])->default('open');
            $table->date('startdatum')->nullable();
            $table->date('einddatum')->nullable();
            $table->text('opmerkingen')->nullable();
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('fases');
    }
};
