<?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
    {
        // The guest's own address (captured after boot), so Traefik routes to the
        // Nextcloud VM rather than the Proxmox host.
        Schema::table('instances', function (Blueprint $table) {
            $table->string('guest_ip')->nullable()->after('vmid');
        });
    }

    public function down(): void
    {
        Schema::table('instances', function (Blueprint $table) {
            $table->dropColumn('guest_ip');
        });
    }
};
