<?php

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

class AddForeignKeysToAbHostServerAffiliateTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('ab_host_server_affiliate', function(Blueprint $table)
		{
			$table->foreign('affiliate_id', 'fk_hsa_aff')->references('id')->on('ab_affiliate')->onUpdate('NO ACTION')->onDelete('NO ACTION');
			$table->foreign('host_server_id', 'fk_hsa_hs')->references('id')->on('ab_host_server')->onUpdate('NO ACTION')->onDelete('NO ACTION');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('ab_host_server_affiliate', function(Blueprint $table)
		{
			$table->dropForeign('fk_hsa_aff');
			$table->dropForeign('fk_hsa_hs');
		});
	}

}
