<?php

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

class ChangeCriteriaObjOutcome extends Migration
{

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('criterion_objective_outcome', function (Blueprint $table) {
			//$table->dropForeign('criterion_objective_outcome_objective_id_foreign');
			//$table->dropForeign('criterion_objective_outcome_outcome_id_foreign');
			//$table->integer('objective_outcome_id');
			DB::statement("ALTER TABLE `criterion_objective_outcome` CHANGE COLUMN `objective_outcome_id` `objective_outcome_id` INT(10) UNSIGNED NOT NULL");
			$table->foreign('objective_outcome_id')->references('id')->on('objective_outcome')->onDelete('cascade')->onUpdate('cascade');
		});
	}

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