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

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

class AddIndexToViolationsOnTargetProjId < Gitlab::Database::Migration[2.1]
  TABLE_NAME = 'merge_requests_compliance_violations'
  # Use function based naming as suggested in docs:
  # https://docs.gitlab.com/ee/development/migration_style_guide.html#truncate-long-index-names
  INDEX_NAME = 'i_compliance_violations_for_export'

  def up
    prepare_async_index TABLE_NAME, [:target_project_id, :id], name: INDEX_NAME
  end

  def down
    unprepare_async_index TABLE_NAME, INDEX_NAME
  end
end