summaryrefslogtreecommitdiff
path: root/db/migrate/20220615105811_add_index_on_clusters_agent_project_id_and_has_vulnerabilities_columns.rb
blob: 007f36c26edcf712ae26d98b7db0a49fc1ebdcf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

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

  INDEX_NAME = 'index_cluster_agents_on_project_id_and_has_vulnerabilities'

  def up
    add_concurrent_index :cluster_agents,
                         [:project_id, :has_vulnerabilities],
                         name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :cluster_agents, INDEX_NAME
  end
end