<?php

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

class CreateTransformativeObjectiveTable extends Migration
{

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


			$table->integer('ta_id')->unsigned();
			$table->foreign('ta_id')
				->references('id')
				->on('transformative_actions')
				->onDelete('cascade')
				->onUpdate('cascade');

			$table->integer('objective_id')->unsigned();
			$table->foreign('objective_id')
				->references('id')
				->on('objectives')
				->onDelete('cascade')
				->onUpdate('cascade');


			/*$table->integer('program_id')->unsigned();
			$table->foreign('program_id')
				->references('id')
				->on('programs')
				->onDelete('cascade')
				->onUpdate('cascade');*/
		});
	}

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