<?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('risicos', function (Blueprint $table) {
            $table->id();
            $table->foreignId('project_id')->constrained('projects')->cascadeOnDelete();
            $table->text('beschrijving');
            $table->enum('impact', ['laag', 'midden', 'hoog'])->default('midden');
            $table->enum('kans', ['laag', 'midden', 'hoog'])->default('midden');
            $table->text('mitigatie')->nullable();
            $table->foreignId('eigenaar_id')->nullable()->constrained('users')->nullOnDelete();
            $table->timestamps();
        });
    }

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