<?php

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

class CreateProgramCriterionObjectiveOutcomeId extends Migration
{

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('program_criterion_objective_outcome', function (Blueprint $table) {

			$table->increments('id');
			$table->integer('program_id')->unsigned();
			$table->integer('cri_obj_out_id')->unsigned();
			$table->foreign('cri_obj_out_id')
				->references('id')
				->on('criterion_objective_outcome')
				->onUpdate('cascade')
				->onDelete('cascade');

			$table->foreign('program_id')
				->references('id')
				->on('programs')
				->onUpdate('cascade')
				->onDelete('cascade');
		});
	}

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