<?php

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

class CreateAbEmailTemplateTranslateTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('ab_email_template_translate', function(Blueprint $table)
		{
			$table->bigInteger('id')->default(0);
			$table->integer('site_id')->default(0);
			$table->bigInteger('email_template_id')->default(0);
			$table->integer('language_id')->default(0)->index();
			$table->string('subject');
			$table->text('message_text');
			$table->text('message_html')->nullable();
			$table->primary(['id','site_id','email_template_id','language_id']);
			$table->index(['email_template_id','site_id']);
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('ab_email_template_translate');
	}

}
