<?php

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

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

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