<?php

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

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

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