<?php

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

class CreateMallOrderExpressesTable extends Migration
{

    /**
     * Run the migrations.
     * @return void
     */
    public function up()
    {
        Schema::create('mall_order_expresses', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('order_id')->index();

            $table->string('name', 32)->nullable();
            $table->string('mobile', 32)->nullable();
            $table->unsignedInteger('province_id')->index()->nullable();
            $table->unsignedInteger('city_id')->index()->nullable();
            $table->unsignedInteger('district_id')->index()->nullable();
            $table->string('address')->nullable();

            $table->unsignedBigInteger('express_id')->nullable()->comment('物流公司');
            $table->string('express_no', 32)->nullable()->comment('物流单号');
            $table->dateTime('deliver_at')->nullable()->comment('发货时间');
            $table->dateTime('receive_at')->nullable()->comment('签收时间');
            $table->timestamps();
        });
    }

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

}