<?php

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

class CreateAbSetupTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('ab_setup', function(Blueprint $table)
		{
			$table->integer('id');
			$table->bigInteger('date_orig')->nullable();
			$table->boolean('active')->nullable();
			$table->integer('country_id')->index('fk_set_cty_idx');
			$table->integer('language_id')->index('fk_set_lan_idx');
			$table->integer('currency_id')->index('fk_set_cur_idx');
			$table->string('url', 256)->default('');
			$table->integer('login_expire')->nullable();
			$table->text('time_format', 65535)->nullable();
			$table->text('date_format', 65535)->nullable();
			$table->integer('decimal_place')->nullable();
			$table->binary('module_config', 65535)->nullable();
			$table->binary('site_details', 65535)->nullable();
			$table->bigInteger('admin_id')->nullable();
			$table->primary(['id','country_id','currency_id','url']);
			$table->index(['admin_id','id'], 'fk_set_acc_idx');
		});
	}


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

}
