<?php

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

class CreateOwnerOutStorageRulesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('owner_out_storage_rules', function (Blueprint $table) {
            $table->id();
            $table->bigInteger("owner_price_operation_id")->index()->comment("外键作业计费模型");
            $table->enum("strategy",["起步","默认","特征"])->comment("出库策略");
            $table->integer("amount")->nullable()->comment("起步数");
            $table->bigInteger("unit_id")->index()->comment("外键单位");
            $table->decimal("unit_price",8,4)->comment("单价");
            $table->string("feature")->nullable()->comment("特征");
            $table->integer("priority")->default(0)->index()->comment("匹配优先级(越大越优先)");
        });
    }

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