Commit 0e9ab359 authored by Patrick Bair's avatar Patrick Bair

Merge branch '350915_add_compound_index_on_project_id_and_id_for_vulnerabilities' into 'master'

Add compound index for `vulnerabilities` table on `project_id` and `id`

See merge request gitlab-org/gitlab!79171
parents a03eeee7 26b89a55
# frozen_string_literal: true
class AddCompoundIndexOnProjectIdAndIdForVulnerabilities < Gitlab::Database::Migration[1.0]
INDEX_NAME = 'index_vulnerabilities_on_project_id_and_id'
disable_ddl_transaction!
def up
add_concurrent_index :vulnerabilities, [:project_id, :id], name: INDEX_NAME
end
def down
remove_concurrent_index :vulnerabilities, [:project_id, :id], name: INDEX_NAME
end
end
6f3a3712288c3316042426d60f087817eb57a3246b750831aa72f95f30269a5d
\ No newline at end of file
......@@ -27951,6 +27951,8 @@ CREATE INDEX index_vulnerabilities_on_last_edited_by_id ON vulnerabilities USING
CREATE INDEX index_vulnerabilities_on_milestone_id ON vulnerabilities USING btree (milestone_id);
CREATE INDEX index_vulnerabilities_on_project_id_and_id ON vulnerabilities USING btree (project_id, id);
CREATE INDEX index_vulnerabilities_on_project_id_and_state_and_severity ON vulnerabilities USING btree (project_id, state, severity);
CREATE INDEX index_vulnerabilities_on_resolved_by_id ON vulnerabilities USING btree (resolved_by_id);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment