<?php

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

class AddIndexesToTpsTables extends Migration
{
    public function up()
    {
        Schema::table('nst_prepare_products', function (Blueprint $table) {
            $table->index('from_location_id');
            $table->index('to_location_id');
            $table->index('variation_id');
            $table->index('nst_shipping_id');
            $table->index(['business_id', 'status']);
        });
    }

    public function down()
    {
        Schema::table('nst_prepare_products', function (Blueprint $table) {
            $table->dropIndex(['from_location_id']);
            $table->dropIndex(['to_location_id']);
            $table->dropIndex(['variation_id']);
            $table->dropIndex(['nst_shipping_id']);
            $table->dropIndex(['business_id', 'status']);
        });
    }
}
