<?php

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

class CreateItemsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('items', function (Blueprint $table) {
            $table->id();
            $table->foreignId('package_id');
            $table->string('name',45);
            $table->string('reference',45);
            $table->string('description',45);
            $table->decimal('quantity', 8, 2);
            $table->string('uom',45);
            $table->decimal('price', 8, 2);
            $table->decimal('total', 8, 2);
            $table->integer('status')->default(0);
            $table->softDeletes();
            $table->timestamps();

        });
    }

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