<?php

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

class AddForeignKeysToAbModuleMethodTokenTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('ab_module_method_token', function(Blueprint $table)
		{
			$table->foreign('account_id', 'fk_mmt_acc')->references('id')->on('ab_account')->onUpdate('NO ACTION')->onDelete('NO ACTION');
			$table->foreign('method_id', 'fk_mmt_mm')->references('id')->on('ab_module_method')->onUpdate('NO ACTION')->onDelete('NO ACTION');
		});
	}


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

}
