<?php

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

class CreateItemsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('items', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('branch_id')->nullable();
            $table->unsignedInteger('inventory_unit_id')->nullable();
            $table->unsignedInteger('inventory_category_id')->nullable();
            $table->string('name')->nullable();
            $table->string('code')->nullable();
            $table->string('description')->nullable();
            $table->double('quantity')->nullable();
            $table->enum('type', ['Service','Product'])->default('Product');
            $table->double('minimum')->nullable();
            $table->double('maximum')->nullable();
            $table->enum('status', ['0','1'])->default('0');
            $table->enum('is_recycle', ['0','1','2'])->default('0');
            $table->timestamps();
        });
    }

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