<?php

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

class ChangeIndexOfStationTaskMaterialBoxesOfStatusStationId extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('station_task_material_boxes', function (Blueprint $table) {
            $table->dropIndex('station_task_material_boxes_station_id_index');
            $table->dropIndex('station_task_material_boxes_status_index');
            $table->index(['status','station_id'],'s_t_material_boxes_i_s_s');
        });
        Schema::table('station_task_commodities', function (Blueprint $table) {
            $table->dropIndex('station_task_commodities_station_id_index');
            $table->dropIndex('station_task_commodities_status_index');
            $table->index(['status','station_id'],'s_t_commodities_i_s_s');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('station_task_material_boxes', function (Blueprint $table) {
            $table->index('status');
            $table->index('station_id');
            $table->dropIndex('s_t_material_boxes_i_s_s');
        });
        Schema::table('station_task_commodities', function (Blueprint $table) {
            $table->index('status');
            $table->index('station_id');
            $table->dropIndex('s_t_commodities_i_s_s');
        });
    }
}
