<?php

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

class CreateAnnualPlanObjectiveTable extends Migration
{

	public function up()
	{
		Schema::create('annual_plan_objective', function (Blueprint $table) {

			$table->increments('id');
			$table->integer('annual_plan_id')->unsigned();
			$table
				->foreign('annual_plan_id')
				->references('id')
				->on('annual_plans')
				->onDelete('cascade')
				->onUpdate('cascade');
			$table->integer('typ_semester_course_id')->unsigned();
			$table
				->foreign('typ_semester_course_id')
				->references('id')
				->on('typ_semester_courses')
				->onDelete('cascade')
				->onUpdate('cascade');
			$table->integer('criteria_id')->unsigned();
			$table->foreign('criteria_id')
				->references('id')
				->on('criteria')
				->onUpdate('cascade')
				->onDelete('cascade');

			$table->timestamps();
		});
	}


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