<?php

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

class CreateAbDomainTldTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('ab_domain_tld', function(Blueprint $table)
		{
			$table->integer('id')->default(0);
			$table->integer('site_id')->default(0);
			$table->bigInteger('date_orig')->nullable();
			$table->bigInteger('date_last')->nullable();
			$table->boolean('active')->nullable();
			$table->string('name', 128)->nullable();
			$table->boolean('taxable')->nullable();
			$table->string('whois_plugin', 32)->nullable();
			$table->text('whois_plugin_data')->nullable();
			$table->integer('registrar_plugin_id')->default(0);
			$table->text('registrar_plugin_data')->nullable();
			$table->boolean('auto_search')->nullable();
			$table->integer('default_term_new')->nullable();
			$table->text('price_group')->nullable();
			$table->primary(['id','site_id','registrar_plugin_id']);
			$table->index(['registrar_plugin_id','site_id'], 'fk_ht_hrp_idx');
		});
	}


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

}
