<?php

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

class CreateTransformativeTypOutcome extends Migration
{

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('transformative_typ_outcome', function (Blueprint $table) {
			$table->increments('id');
			$table->integer('trans_id')->unsigned();
			$table->integer('typ_semester_outcome_id')->unsigned();
			$table->foreign('trans_id')
				->references('id')
				->on('transformative_actions')
				->onDelete('cascade')
				->onUpdate('cascade');
			$table->foreign('typ_semester_outcome_id')
				->references('id')
				->on('typ_semester_outcome')
				->onDelete('cascade')
				->onUpdate('cascade');
			$table->integer('proposing_coordinator_id')->unsigned();
			$table->foreign('proposing_coordinator_id')
				->references('id')
				->on('users')
				->onDelete('cascade')
				->onUpdate('cascade');



			$table->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
			$table->timestamp('updated_at')->nullable();
			$table->timestamp('deleted_at')->nullable();
			//$table->softDeletes()->default(DB::raw('CURRENT_TIMESTAMP'));

		});
	}

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