<?php

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

class CreateOwnerPriceLogisticsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('owner_price_logistics', function (Blueprint $table) {
            $table->id();
            $table->string("name")->comment("名称");
            $table->string("unit_range")->nullable()->comment("单位一区间");
            $table->bigInteger("unit_id")->index()->comment("外键单位：单位一");
            $table->string("other_unit_range")->nullable()->comment("单位二区间");
            $table->bigInteger("other_unit_id")->index()->comment("外键单位：单位二");
            $table->decimal("pick_up_price",8,4)->nullable()->comment("提货费");
            $table->decimal("fuel_price",8,4)->nullable()->comment("燃油附加费");
            $table->decimal("service_price",8,4)->nullable()->comment("信息服务费");
            $table->timestamps();
        });
    }

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