<?php

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

class CreateStockCompositeItemsTable extends Migration {

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

			$table->primary(['parent_id', 'child_id']);
		});
	}

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

}
