<?php

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

class CreateStoreCheckingReceiveItemsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('store_checking_receive_items', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('store_checking_receive_id')->comment('外键任务');
            $table->integer('bin_number')->nullable()->comment('格口号');
            $table->bigInteger('commodity_id')->index()->comment('外键商品');
            $table->integer('imported_amount')->nullable()->comment('导入数量');
            $table->integer('counted_amount')->nullable()->comment('实盘数量');
            $table->integer('asn_amount')->nullable()->comment('ASN数量');
            $table->integer('imported_diff_amount')->nullable()->comment('导入差异');
            $table->integer('asn_diff_amount')->nullable()->comment('ASN差异');
            $table->date('produced_at')->nullable()->comment('生产日期');
            $table->date('invalid_at')->nullable()->comment('失效日期');
            $table->string('batch_code')->nullable()->comment('批号');
            $table->string('unique_code')->nullable()->comment('唯一码');
        });
    }

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