<?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('metro_nodes', function (Blueprint $table) {
            $table->id();
            $table->foreignId('metro_line_id')->constrained('metro_lines')->cascadeOnDelete();
            $table->string('naam', 255);
            $table->text('beschrijving')->nullable();
            $table->string('status')->default('active');
            $table->integer('x')->default(0);
            $table->integer('y')->default(0);
            $table->integer('order')->default(0);
            $table->foreignId('eigenaar_id')->nullable()->constrained('users')->nullOnDelete();
            $table->timestamps();
        });
    }

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