class RemoveObseleteContentItemsIndex < Mongoid::Migration
  def self.up
    collection.indexes.drop_one(key)
  end

  def self.down
    collection.indexes.create_one(key)
  end

private

  def self.key
    { content_id: 1, locale: 1, format: 1, updated_at: -1, title: 1, _id: 1 }
  end

  def self.collection
    db = connection.database
    db.collection(:content_items)
  end
end

Remove an obselete content items index
Remove an obselete content items index

The long index name is causing problems in migrating to mongodb 2.6
and having discussed its creation with the author its no longer needed.
