<?php

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

class AddColumnStationTaskIdForAllSubTasks extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('station_task_batches', function (Blueprint $table) {
            $table->integer('station_task_id')->index()->nullable();
        });
        Schema::table('station_task_commodities', function (Blueprint $table) {
            $table->integer('station_task_id')->index()->nullable();
        });
        Schema::table('station_task_material_boxes', function (Blueprint $table) {
            $table->integer('station_task_id')->index()->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('station_task_batches', function (Blueprint $table) {
            $table->dropColumn('station_task_id');
        });
        Schema::table('station_task_commodities', function (Blueprint $table) {
            $table->dropColumn('station_task_id');
        });
        Schema::table('station_task_material_boxes', function (Blueprint $table) {
            $table->dropColumn('station_task_id');
        });

    }
}
