<?php

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

class CreateTypSemesterCoursesTable extends Migration
{


	public function up()
	{
		Schema::create('typ_semester_courses', function (Blueprint $table) {
			$table->increments('id');
			$table->timestamps();
			$table->integer('typ_semester_objective_id')->unsigned();
			$table->integer('course_id')->unsigned();


			$table->foreign('typ_semester_objective_id')
				->references('id')
				->on('typ_semester_objectives')
				->onDelete('cascade')
				->onUpdate('cascade');
			$table->foreign('course_id')
				->references('id')
				->on('courses')
				->onDelete('cascade')
				->onUpdate('cascade');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{

		Schema::drop('typ_semester_courses');
	}
}
