<?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('quote_details', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger(column: 'quote_id')->nullable();
            $table->foreign('quote_id')->references('id')->on('quotes');

            $table->unsignedBigInteger(column: 'property_id')->nullable();
            $table->foreign('property_id')->references('id')->on('properties');

            $table->float('price', 15, 2)->nullable();
            $table->float('price_it', 15, 2)->nullable();
            $table->float('price_contrato', 15, 2)->nullable();
            $table->timestamps();
        });
    }

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