debian-mirror-gitlab/db/post_migrate/20220316165539_add_index_to_vulnerabilities.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
437 B
Ruby
Raw Normal View History

2022-06-21 17:19:12 +05:30
# frozen_string_literal: true
class AddIndexToVulnerabilities < Gitlab::Database::Migration[1.0]
INDEX_NAME = 'index_vulnerabilites_common_finder_query'
disable_ddl_transaction!
def up
add_concurrent_index(
:vulnerabilities,
%i[project_id state report_type severity id],
name: INDEX_NAME
)
end
def down
remove_concurrent_index_by_name(
:vulnerabilities,
INDEX_NAME
)
end
end