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

20211102103127_add_temp_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: 4aee79950dc0c217a3e282401283f0d5c1e80cb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class AddTempIndexToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0]
  INDEX_NAME = 'vulnerability_occurrences_location_temp_index'

  disable_ddl_transaction!

  def up
    add_concurrent_index :vulnerability_occurrences, :id, where: 'location IS NULL', name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :vulnerability_occurrences, name: INDEX_NAME
  end
end