<?php

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

class CreateStockItemsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('stock_items', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('stock_id')->unsigned()->index();
			$table->float('margin')->default(0);
			$table->float('business_margin')->default(0);
			$table->float('cost')->unsigned()->default(0);
			$table->integer('quantity');
			$table->unsignedBigInteger('supplier_id');
			$table->timestamps();
		});
	}

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

}
