summaryrefslogtreecommitdiff
path: root/db/post_migrate/20220630050050_index_vulnerability_reads_on_casted_cluster_agent_id_full.rb
blob: 58b6342e30f5b3cd6f2147f5e6659bb5990e7fd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

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

  INDEX_NAME = 'index_vuln_reads_on_casted_cluster_agent_id_where_it_is_null'

  def up
    add_concurrent_index :vulnerability_reads,
      :casted_cluster_agent_id,
      name: INDEX_NAME,
      where: 'casted_cluster_agent_id IS NOT NULL'
  end

  def down
    remove_concurrent_index_by_name :vulnerability_reads, INDEX_NAME
  end
end