<?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('acties', function (Blueprint $table) {
            $table->id();
            $table->foreignId('commitment_id')->constrained('commitments')->cascadeOnDelete();
            $table->text('beschrijving');
            $table->foreignId('eigenaar_id')->constrained('users')->restrictOnDelete();
            $table->date('deadline')->nullable();
            $table->enum('status', ['open', 'in_uitvoering', 'afgerond'])->default('open');
            $table->enum('prioriteit', ['laag', 'midden', 'hoog'])->default('midden');
            $table->timestamps();
        });
    }

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