<?php

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

class Create5cc31c4ea9392ResidentialComplexResidentialComplexTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if(! Schema::hasTable('residential_complex_residential_complex')) {
            Schema::create('residential_complex_residential_complex', function (Blueprint $table) {
                $table->integer('residential_complex_id')->unsigned()->nullable();
                $table->foreign('residential_complex_id', 'fk_p_295424_295424_reside_5cc31c4ea9541')->references('id')->on('residential_complexes')->onDelete('cascade');
                $table->integer('residential_complex_recommended_id')->unsigned()->nullable();
                $table->foreign('residential_complex_recommended_id', 'fk_p_295424_295424_reside_5cc31c4ea9633')->references('id')->on('residential_complexes')->onDelete('cascade');
                
            });
        }
    }

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