<?php

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

class CreateAbHostServerAffiliateTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('ab_host_server_affiliate', function(Blueprint $table)
		{
			$table->bigInteger('id');
			$table->integer('site_id');
			$table->bigInteger('affiliate_id');
			$table->integer('host_server_id');
			$table->string('host_username', 45)->nullable();
			$table->string('host_password', 45)->nullable();
			$table->primary(['id','site_id','affiliate_id','host_server_id']);
			$table->index(['affiliate_id','site_id']);
			$table->index(['host_server_id','site_id']);
		});
	}


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

}
