<?php

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

class Add5d13367a240a7RelationshipsToSectionTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('sections', function (Blueprint $table) {
            if (!Schema::hasColumn('sections', 'quarterly_start_id')) {
                $table->integer('quarterly_start_id')->unsigned()->nullable();
                $table->foreign('quarterly_start_id', '296285_5d133675bacd2')
                    ->references('id')->on('quarterlies')->onDelete('set null');
            }
            if (!Schema::hasColumn('sections', 'quarterly_finish_id')) {
                $table->integer('quarterly_finish_id')->unsigned()->nullable();
                $table->foreign('quarterly_finish_id', '296285_5d133675d9831')
                    ->references('id')->on('quarterlies')->onDelete('set null');
            }
        });
    }

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