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

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

class AddProjectIdStateSeverityDefaultBranchIndexForVulnerabilities < Gitlab::Database::Migration[2.0]
  disable_ddl_transaction!

  INDEX_NAME = 'index_vulnerabilities_project_id_state_severity_default_branch'

  def up
    add_concurrent_index :vulnerabilities, [:project_id, :state, :severity, :present_on_default_branch],
                         name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :vulnerabilities, INDEX_NAME
  end
end