<?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::create('cotratti_affittis', function (Blueprint $table) {
            $table->id();
            $table->timestamps();
            $table->foreignId('immobile_id');
            $table->foreignId('tipo_contratto_id');
            $table->date('data_inizio')->nullable();
            $table->date('data_fine')->nullable();
            $table->unsignedTinyInteger('tacito_rinnovo');
            $table->string('canone_mensile')->nullable();
            $table->string('deposito_cauzionale')->nullable();
            $table->string('spese_condominiali')->nullable();
            $table->string('iva')->nullable();
            $table->string('registrazione')->nullable();
            $table->string('note')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('cotratti_affittis');
    }
};
