<?php

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

class TypProgram extends Migration
{

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('typ_program', function (Blueprint $table) {
			$table->increments('id');
			$table->timestamps();
			$table->integer('three_year_plan_id')->unsigned();
			$table->integer('program_id')->unsigned();
			$table->foreign('program_id')
				->references('id')
				->on('programs')
				->onDelete('cascade')
				->onUpdate('cascade');
			$table->foreign('three_year_plan_id')
				->references('id')
				->on('three_year_plan')
				->onDelete('cascade')
				->onUpdate('cascade');
		});
	}

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