19 lines
586 B
Ruby
19 lines
586 B
Ruby
![]() |
# frozen_string_literal: true
|
||
|
|
||
|
class AddIndexOnVulnerabilityReadsNamespaceIdWithReportType < Gitlab::Database::Migration[2.0]
|
||
|
INDEX_NAME = 'index_vulnerability_reads_common_finder_query_with_namespace_id'
|
||
|
|
||
|
disable_ddl_transaction!
|
||
|
|
||
|
def up
|
||
|
add_concurrent_index :vulnerability_reads,
|
||
|
[:namespace_id, :state, :report_type, :severity, :vulnerability_id],
|
||
|
name: INDEX_NAME,
|
||
|
order: { vulnerability_id: :desc }
|
||
|
end
|
||
|
|
||
|
def down
|
||
|
remove_concurrent_index_by_name :vulnerability_reads, INDEX_NAME
|
||
|
end
|
||
|
end
|