<?php

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

class CreateRejectedBillItemsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('rejected_bill_items', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('id_rejected_bill')->index();
            $table->string('barcode_goods')->index()->nullable();
            $table->string('name_goods')->nullable();
            $table->integer('amount');
            $table->bigInteger('id_quality_label');
            $table->string('batch_number')->nullable();
            $table->date('made_at')->nullable();
            $table->date('validity_at')->nullable();
            $table->string('remark')->nullable();
            $table->enum('is_loaded',['无需入库','已入库','未入库','待推单'])->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

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