summaryrefslogtreecommitdiff
path: root/db/post_migrate/20200207184023_add_temporary_index_to_promotion_notes.rb
blob: 44a32938483cf8b608573b05ad38f3a36b0d263b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.

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

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_concurrent_index :notes,
      :note,
      where: "noteable_type = 'Issue' AND system IS TRUE AND note LIKE 'promoted to epic%'",
      name: 'tmp_idx_on_promoted_notes'
  end

  def down
    # NO OP
  end
end