<?php

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

class CreateOrderTrackingsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_trackings', function (Blueprint $table) {
            $table->id();
            $table->integer('order_package_commodity_id')->index();
            $table->integer('owner_id')->index();
            $table->string('web_order_number')->nullable();
            $table->timestamp('pick_up_at')->nullable();
            $table->string('sale')->nullable();
            $table->string('client')->nullable();
            $table->string('order_remark')->nullable();
            $table->string('pallet_total')->nullable();
            $table->timestamp('planning_sent_at')->nullable();
            $table->enum('is_on_duty_shift',['是','否'])->default(null)->nullable();
            $table->enum('is_arrival',['是','否'])->default(null)->nullable();
            $table->timestamp('signed_at')->nullable();
            $table->string('receive_bill_status')->nullable();
            $table->string('remark')->nullable();
            $table->timestamp('created_at')->index();
            $table->timestamp('updated_at')->index();
        });
    }

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