<?php

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

class AddSemesterIdTransformativeActionStatus extends Migration
{

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('transformative_action_status', function (Blueprint $table) {
			$table->integer('semester_id')->unsigned();
			$table->foreign('semester_id')
				->references('id')
				->on('semesters')
				->onDelete('cascade')
				->onUpdate('cascade');
		});
	}

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