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

20221121152048_remove_unused_feedback_migration_index.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b5dbafccd3a207f3d5b2aaf21c9b8fc475e4eb98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

class RemoveUnusedFeedbackMigrationIndex < Gitlab::Database::Migration[2.0]
  INDEX_NAME = "tmp_idx_for_vulnerability_feedback_migration"
  WHERE_CLAUSE = "migrated_to_state_transition = false AND feedback_type = 0"

  disable_ddl_transaction!

  def up
    remove_concurrent_index_by_name(
      :vulnerability_feedback,
      INDEX_NAME
    )
  end

  def down
    add_concurrent_index(
      :vulnerability_feedback,
      %i[migrated_to_state_transition feedback_type],
      where: WHERE_CLAUSE,
      name: INDEX_NAME
    )
  end
end