<?php

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

class Add5d41af3cb1abaRelationshipsToCustomerAppealTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('customer_appeals', function(Blueprint $table) {
            if (!Schema::hasColumn('customer_appeals', 'customer_appeal_option_id')) {
                $table->integer('customer_appeal_option_id')->unsigned()->nullable();
                $table->foreign('customer_appeal_option_id', '329913_5d417193dae9c')->references('id')->on('customer_appeal_options')->onDelete('set null');
                }
                if (!Schema::hasColumn('customer_appeals', 'developer_id')) {
                $table->integer('developer_id')->unsigned()->nullable();
                $table->foreign('developer_id', '329913_5d41719413891')->references('id')->on('developers')->onDelete('set null');
                }
                if (!Schema::hasColumn('customer_appeals', 'residential_complexes_id')) {
                $table->integer('residential_complexes_id')->unsigned()->nullable();
                $table->foreign('residential_complexes_id', '329913_5d41af37db6bc')->references('id')->on('residential_complexes')->onDelete('set null');
                }
                
        });
    }

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