<?php

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

class CreateBuildPlannedComponentsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('build_planned_components', function(Blueprint $table){
			$table->unsignedBigInteger('build_id');
			$table->unsignedBigInteger('stock_id');
			$table->integer('quantity');
			$table->timestamps();

			$table->primary(['build_id', 'stock_id']);

		});
	}

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

}
