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

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

class AddAgentIdLocationIndexToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0]
  disable_ddl_transaction!

  INDEX_NAME = 'index_vulnerability_occurrences_on_location_agent_id'

  def up
    add_concurrent_index :vulnerability_occurrences, "(location -> 'agent_id')",
                         using: 'GIN',
                         where: 'report_type = 7',
                         name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME
  end
end