<?php

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

class TypSemesterOutcome extends Migration
{

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('typ_semester_outcome', function (Blueprint $table) {
			$table->increments('id');
			$table->timestamps();
			$table->integer('typ_program_id')->unsigned();
			$table->integer('semester_id')->unsigned();
			$table->integer('outcome_id')->unsigned();

			$table->foreign('outcome_id')
				->references('id')
				->on('outcomes')
				->onDelete('cascade')
				->onUpdate('cascade');
			$table->foreign('semester_id')
				->references('id')
				->on('semesters')
				->onDelete('cascade')
				->onUpdate('cascade');
			$table->foreign('typ_program_id')
				->references('id')
				->on('typ_program')
				->onDelete('cascade')
				->onUpdate('cascade');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('typ_semester_outcome');
	}
}
