<?php

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

class AddColumnStationIdForStationTasks extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('station_tasks', function (Blueprint $table) {
            $table->unsignedBigInteger('station_id')->nullable();
            $table->index(['station_id','status'],'station_tasks_i_s_id_status');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('station_tasks', function (Blueprint $table) {
            $table->dropColumn('station_id');
            $table->dropIndex('station_tasks_i_s_id_status');
        });
    }
}
