<?php

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

class Add5cbecd6299bd5RelationshipsToSecretBuyerRatingTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('secret_buyer_ratings', function (Blueprint $table) {
            if (!Schema::hasColumn('secret_buyer_ratings', 'residental_complex_id')) {
                $table->integer('residental_complex_id')->unsigned()->nullable();
                $table->foreign('residental_complex_id',
                    '295670_5cbecd5ecde23')->references('id')->on('residential_complexes')->onDelete('cascade');
            }
        });
    }

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