<?php

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

class CreateOrderPackageExceptionTypeCountingRecordsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_package_exception_type_counting_records', function (Blueprint $table) {
            $table->id();
            $table->date("sent_at_date")->comment("发出日期");
            $table->string('exception_type')->comment('异常名称');
            $table->integer('exception_type_count')->comment('异常类型的统计数量');
            $table->unsignedBigInteger('owner_id')->comment('货主ID');
            $table->index(['sent_at_date', 'exception_type_count', 'owner_id'],'order_packages_s_et_o_index');
        });
    }

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