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

20221124153602_add_supporting_index_for_vulnerabilities_feedback_comment_proccessing.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 71f48e22b52b8e1bb29b80305d46dc53d735d3c9 (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 AddSupportingIndexForVulnerabilitiesFeedbackCommentProccessing < Gitlab::Database::Migration[2.0]
  INDEX_NAME = "tmp_idx_for_feedback_comment_processing"
  WHERE_CLAUSE = "char_length(comment) > 50000"

  disable_ddl_transaction!

  def up
    add_concurrent_index(
      :vulnerability_feedback,
      :id,
      where: WHERE_CLAUSE,
      name: INDEX_NAME
    )
  end

  def down
    remove_concurrent_index_by_name(
      :vulnerability_feedback,
      INDEX_NAME
    )
  end
end