<?php

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

class CreateStationTaskMaterialBoxesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('station_task_material_boxes', function (Blueprint $table) {
            $table->id();
            $table->integer('station_id')->index();
            $table->integer('material_box_id');  //联合索引
            $table->enum('status',['待处理','挂起','处理中','完成','异常','取消'])->index();  //联合索引
            $table->index(['material_box_id','status']);
            $table->timestamps();
        });
    }

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