<?php

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

class AddForeignKeysToAbGroupMethodTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('ab_group_method', function(Blueprint $table)
		{
			$table->foreign('group_id', 'fk_gm_grp')->references('id')->on('ab_group')->onUpdate('NO ACTION')->onDelete('NO ACTION');
			$table->foreign('method_id', 'fk_gm_mm')->references('id')->on('ab_module_method')->onUpdate('NO ACTION')->onDelete('NO ACTION');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('ab_group_method', function(Blueprint $table)
		{
			$table->dropForeign('fk_gm_grp');
			$table->dropForeign('fk_gm_mm');
		});
	}

}
