<?php

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

class AddForeignKeysToAbSetupTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('ab_setup', function(Blueprint $table)
		{
			$table->foreign('admin_id', 'fk_set_acc')->references('id')->on('ab_account')->onUpdate('NO ACTION')->onDelete('NO ACTION');
			$table->foreign('country_id', 'fk_set_cty')->references('id')->on('ab_country')->onUpdate('NO ACTION')->onDelete('NO ACTION');
			$table->foreign('currency_id', 'fk_set_cur')->references('id')->on('ab_currency')->onUpdate('NO ACTION')->onDelete('NO ACTION');
			$table->foreign('language_id', 'fk_set_lan')->references('id')->on('ab_language')->onUpdate('NO ACTION')->onDelete('NO ACTION');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('ab_setup', function(Blueprint $table)
		{
			$table->dropForeign('fk_set_acc');
			$table->dropForeign('fk_set_cty');
			$table->dropForeign('fk_set_cur');
			$table->dropForeign('fk_set_lan');
		});
	}

}
