<?php

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

class CreateSpecialtyBranchesTable extends Migration {

	public function up()
	{
		Schema::create('specialty_branches', function(Blueprint $table) {
			$table->increments('id');

			$table->integer('specialty_id')->unsigned()->nullable();
			$table->foreign('specialty_id')->references('id')->on('specialties');

			$table->integer('branch_id')->unsigned()->nullable();
			$table->foreign('branch_id')->references('id')->on('branches');
			
            $table->softDeletes();
            $table->timestamps();
            $table->engine = 'InnoDB';
		});
	}

	public function down()
	{
		Schema::drop('specialty_branches');
	}
}