<?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',['正常','快速入库'])->default('正常');
            $table->enum('status',['无需入库','已入库','未入库','待推单'])->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');
    }
}
