<?php

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

class CreateSiteDetailsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('site_details', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('building_stage_id')->nullable()->unsigned();
            $table->foreign('building_stage_id')->references('id')->on('building_stage');
            $table->bigInteger('building_type_id')->nullable()->unsigned();
            $table->foreign('building_type_id')->references('id')->on('building_type');
            $table->bigInteger('building_description_id')->nullable()->unsigned();
            $table->foreign('building_description_id')->references('id')->on('building_description');
            $table->double('no_of_bedrooms')->nullable();
            $table->double('no_of_bathrooms')->nullable();
            $table->timestamps();
        });
    }

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