<?php

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

class Add5cc1726cc243aRelationshipsToPlanningFlorTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('planning_flors', function (Blueprint $table) {
            if (!Schema::hasColumn('planning_flors', 'floor_id')) {
                $table->integer('floor_id')->unsigned()->nullable();
                $table->foreign('floor_id',
                    '296718_5cc17269563d9')->references('id')->on('floors')->onDelete('cascade');
            }
            if (!Schema::hasColumn('planning_flors', 'plannig_id')) {
                $table->integer('plannig_id')->unsigned()->nullable();
                $table->foreign('plannig_id',
                    '296718_5cc172697af1d')->references('id')->on('plannings')->onDelete('cascade');
            }
        });
    }

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