<?php

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

class Add5d13381155571RelationshipsToResidentialComplexTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('residential_complexes', function (Blueprint $table) {
            if (!Schema::hasColumn('residential_complexes', 'quarterly_putting_into_operation_id')) {
                $table->integer('quarterly_putting_into_operation_id')->unsigned()->nullable();
                $table->foreign('quarterly_putting_into_operation_id', '295424_5d13380b85213')
                    ->references('id')->on('quarterlies')->onDelete('set null');
            }
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('residential_complexes', function (Blueprint $table) {
        });
    }
}
