<?php

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

class CreateOverviewTable extends Migration
{

	public function up()
	{
		//
		Schema::create('overview', function (Blueprint $table) {
			$table->increments('id');

			$table->integer('program_id')->unsigned();
			$table->foreign('program_id')
				->references('id')
				->on('programs')
				->onDelete('cascade')
				->onUpdate('cascade');
			$table->integer('outcome_id')->unsigned();
			$table->foreign('outcome_id')
				->references('id')
				->on('outcomes')
				->onDelete('cascade')
				->onUpdate('cascade');
			$table->integer('semester_id')->unsigned();
			$table->foreign('semester_id')
				->references('id')
				->on('semesters')
				->onDelete('cascade')
				->onUpdate('cascade');

			$table->integer('total_evaluated')->unsigned();
			$table->integer('total_achieved')->unsigned();
		});
	}

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