<?php

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

class CreateOwnerPriceLogisticDetailsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('owner_price_logistic_details', function (Blueprint $table) {
            $table->id();
            $table->bigInteger("owner_price_logistic_id")->index()->comment("外键物流计费");
            $table->bigInteger("unit_id")->index()->comment("单位");
            $table->string("range")->nullable()->comment("区间");
            $table->bigInteger("province_id")->nullable()->index()->comment("外键省份");
            $table->bigInteger("city_id")->nullable()->index()->comment("外键城市");
            $table->decimal("unit_price",8,4)->nullable()->comment("单价");
            $table->decimal("delivery_fee",8,4)->nullable()->comment("送货费");
            $table->decimal("initial_fee",8,4)->nullable()->comment("起始计费");
            $table->integer("initial_amount")->nullable()->comment("起始计数");
            $table->decimal("rate")->nullable()->comment("费率");
            $table->timestamps();
        });
    }

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