<?php

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

class AddUniqueIndexToFiveYearPlansTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('five_year_plans', function(Blueprint $table)
		{
			$table->unique(array('quinquennium_id', 'program_id'));
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('five_year_plans', function(Blueprint $table)
		{
			$table->dropUnique('five_year_plans_quinquennium_id_program_id_unique');
		});
	}

}
