<?php

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

class AddVirtualOrderCardsPartitionIdIdx extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('virtual_order_cards', function (Blueprint $table) {
            $table->index(['id']);
        });

        Schema::table('virtual_order_renewal_cards', function (Blueprint $table) {
            $table->index(['id']);
        });

        Schema::table('virtual_order_renewal_package_cards', function (Blueprint $table) {
            $table->index(['id']);
        });

        Schema::table('virtual_order_flows_package_cards', function (Blueprint $table) {
            $table->index(['id']);
        });

        Schema::table('virtual_order_upgrade_cards', function (Blueprint $table) {
            $table->index(['id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('virtual_order_cards', function (Blueprint $table) {
            $table->dropIndex("virtual_order_cards_id_index");
        });

        Schema::table('virtual_order_renewal_cards', function (Blueprint $table) {
            $table->dropIndex("virtual_order_renewal_cards_id_index");
        });

        Schema::table('virtual_order_renewal_package_cards', function (Blueprint $table) {
            $table->dropIndex("virtual_order_renewal_package_cards_id_index");
        });

        Schema::table('virtual_order_flows_package_cards', function (Blueprint $table) {
            $table->dropIndex("virtual_order_flows_package_cards_id_index");
        });

        Schema::table('virtual_order_upgrade_cards', function (Blueprint $table) {
            $table->dropIndex("virtual_order_upgrade_cards_id_index");
        });
    }
}
