<?php

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

class CreateAbProductCatTranslateTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('ab_product_cat_translate', function(Blueprint $table)
		{
			$table->integer('id')->default(0);
			$table->integer('site_id')->default(0);
			$table->integer('product_cat_id')->default(0);
			$table->integer('language_id')->default(0)->index();
			$table->string('name', 128)->nullable();
			$table->binary('description', 65535)->nullable();
			$table->primary(['id','site_id','product_cat_id','language_id']);
			$table->unique(['site_id','product_cat_id','language_id']);
			$table->index(['product_cat_id','site_id']);
		});
	}


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

}
