Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20210331180118_remove_deprecated_index_from_award_emoji.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b8787eb171ca84eb5a34d9151df867e1f9c4b0ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class RemoveDeprecatedIndexFromAwardEmoji < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false
  INDEX_NAME = 'index_award_emoji_on_user_id_and_name'

  disable_ddl_transaction!

  def up
    # Index deprecated in favor of idx_award_emoji_on_user_emoji_name_awardable_type_awardable_id
    remove_concurrent_index_by_name(:award_emoji, INDEX_NAME)
  end

  def down
    add_concurrent_index(:award_emoji, [:user_id, :name], name: INDEX_NAME)
  end
end