<?php

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

class CreatePartCompositeItemsTable extends Migration {

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

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

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

}
