class RenameAutomaticExploitationIndex < ActiveRecord::Migration
  def up
    if index_name_exists? :automatic_exploitation_matches, :index_automatic_exploitation_matches_on_ref_id, false
      rename_index :automatic_exploitation_matches,
      :index_automatic_exploitation_matches_on_ref_id,
      :index_automatic_exploitation_matches_on_module_detail_id
    end
  end
  def down
    if index_name_exists? :automatic_exploitation_matches, :index_automatic_exploitation_matches_on_module_detail_id, false
      rename_index :automatic_exploitation_matches,
      :index_automatic_exploitation_matches_on_module_detail_id,
      :index_automatic_exploitation_matches_on_ref_id
    end
  end
end
