id(); $table->string('codice_stabile', 8)->unique(); $table->string('denominazione'); $table->string('indirizzo'); $table->string('citta'); $table->string('cap'); $table->string('provincia'); $table->string('nazione')->default('IT'); $table->string('codice_fiscale')->nullable(); $table->string('partita_iva')->nullable(); $table->text('note')->nullable(); $table->boolean('attivo')->default(true); $table->timestamps(); $table->softDeletes(); }); } else { // Table already exists, just add any missing columns if needed Schema::table('stabili', function (Blueprint $table) { if (!Schema::hasColumn('stabili', 'codice_stabile')) { $table->string('codice_stabile', 8)->unique()->after('id'); } if (!Schema::hasColumn('stabili', 'attivo')) { $table->boolean('attivo')->default(true)->after('note'); } }); } } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('stabili'); } };