<?php

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

class CreateItemsTable extends Migration
{
    /*
     * Run the migrations.
     *
     * @return void
     */

    public function up()
    {

        /*
         * Table: items
         */
        Schema::create('items', function ($table) {
            $table->increments('id');
            $table->integer('purchase_order_id')->nullable();
            $table->integer('item_id')->nullable();
            $table->string('code', 100)->nullable();
            $table->string('uom', 100)->nullable();
            $table->integer('tax_id')->nullable();
            $table->integer('date')->nullable();
            $table->integer('qty')->nullable();
            $table->double('unit_price', 10,3)->nullable();
            $table->double('discount', 10,3)->nullable();
            $table->double('subtotal', 10,3)->nullable();
            $table->softDeletes();
            $table->nullableTimestamps();
        });
    }

    /*
    * Reverse the migrations.
    *
    * @return void
    */

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