<?php

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

class RemoveOutcomeIdFromObjectivesTable extends Migration
{

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		//Schema::table('objectives', function(Blueprint $table)
		//{
		//    $table->dropForeign('objectives_outcome_id_foreign');
		//	$table->dropColumn('outcome_id');
		//});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('objectives', function (Blueprint $table) {
			$table
				->integer('outcome_id')
				->after('id')
				->unsigned();
			$table
				->foreign('outcome_id')
				->references('id')
				->on('outcomes')
				->onDelete('cascade')
				->onUpdate('cascade');
		});
	}
}
