<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('stabili', function (Blueprint $table) {
            // Registro Amministratori (Legge 220/2012 Art.10 c.7)
            $table->date('registro_data_nomina')->nullable()->comment('Data nomina amministratore attuale');
            $table->date('registro_scadenza')->nullable()->comment('Data scadenza mandato amministratore');
            $table->string('registro_delibera')->nullable()->comment('Numero delibera di nomina');
            $table->text('registro_note')->nullable()->comment('Note aggiuntive sul mandato');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('stabili', function (Blueprint $table) {
            $table->dropColumn([
                'registro_data_nomina',
                'registro_scadenza', 
                'registro_delibera',
                'registro_note'
            ]);
        });
    }
};
