<?php

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

class CreateTargetOutcomesProgramTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('target_outcomes_program', function (Blueprint $table) {
			$table->increments('id');
			$table->integer('program_id')->unsigned();
			$table->integer('semester_id')->unsigned();
			$table->decimal('expected_target', 5, 2)->default('70.00');
			$table->timestamps();
			$table->foreign('semester_id')
				->references('id')
				->on('semesters')
				->onDelete('cascade')
				->onUpdate('cascade');

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

		});
	}

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

}
