<?php

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

class AddFacilityRequest extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('facility_request', function(Blueprint $table)
		{
			$table->integer('dispatched_by')->unsigned();
			$table->integer('received_by')->unsigned();
			$table->integer('samples_collected')->nullable();
			$table->date('cphl_date_received');
			$table->date('hub_date_received');
			$table->date('date_received');
			$table->integer('dispatch_tat1');
			$table->integer('dispatch_tat2');
			$table->integer('dispatch_tat3');

			$table->foreign('received_by')->references('id')->on('users');
			$table->foreign('dispatched_by')->references('id')->on('users');
			$table->date('cphl_date_received')->nullable();
			$table->date('hub_date_received')->nullable();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('facility_request', function(Blueprint $table)
		{

		});
	}

}
