<?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
    {
        Schema::create('details', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('property_id');
            $table->string('property_size')->nullable();
            $table->integer('bedrooms')->nullable();
            $table->integer('bathroom')->nullable();
            $table->string('kitchen')->nullable();
            $table->string('dining_area')->nullable();
            $table->string('balkani')->nullable();
            $table->string('car_parking')->nullable();
            $table->integer('garage')->nullable();
            $table->string('garage_size')->nullable();
            $table->integer('year_built')->nullable();
            $table->string('property_type')->nullable();
            $table->string('property_status')->nullable();
            $table->string('furnishing')->nullable();
            $table->string('total_floors')->nullable();
            $table->string('maintenance_monthly')->nullable();
            $table->string('floor_no')->nullable();
            $table->string('facing')->nullable();
            $table->string('project_name')->nullable();
            $table->timestamps();

            // Foreign Key Constraint
            $table->foreign('property_id')->references('id')->on('properties')->onDelete('cascade');
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('details');
    }
};

