<?php

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

class AddForeignKeysToAbEmailTemplateTranslateTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('ab_email_template_translate', function(Blueprint $table)
		{
			$table->foreign('email_template_id', 'fk_emt_et')->references('id')->on('ab_email_template')->onUpdate('NO ACTION')->onDelete('NO ACTION');
			$table->foreign('language_id', 'fk_emt_lan')->references('id')->on('ab_language')->onUpdate('NO ACTION')->onDelete('NO ACTION');
		});
	}


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

}
