<?php

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

class CreateStoresTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('stores', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('asn_code')->nullable()->unique()->comment('WMS的ASNNO单号');
            $table->integer('warehouse_id')->nullable()->comment('仓库ID');
            $table->integer('owner_id')->index()->nullable()->comment('货主ID');
            $table->enum('stored_method',['正常','快速入库','采购入库','笕尚退货入库单','笕尚进仓入库单','笕尚移仓入库单','B2B入库','笕尚调整入库单','换货入库','初始化库存','虚拟入库','其他入库','退货入库','调拨入库'])->default('正常');
            $table->enum('status',['无需入库','已入库','未入库','待推单','完全收货','部分收货','已码盘','订单创建','ASN关闭','等待释放','收货取消'])->default(null)->nullable();
            $table->string('remark')->nullable();
            $table->timestamp('deleted_at')->nullable()->index();
            $table->timestamp('updated_at')->nullable();
            $table->timestamp('created_at')->nullable()->index();
        });
    }

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