Commit 9645fc7f authored by Michał Zając's avatar Michał Zając

Add IssueLinks migration helper index

This index is needed to back the data integrity fixing process outlined
in https://gitlab.com/gitlab-org/gitlab/-/issues/224457
parent ed27c18e
---
title: Add migration helper index for Vulnerabilities::Finding table
merge_request: 38898
author:
type: changed
# frozen_string_literal: true
class AddMigrationIndexToVulnerabilitiesOccurrences < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :vulnerability_occurrences,
"project_id, report_type, encode(project_fingerprint, 'hex'::text)",
name: 'index_vulnerability_occurrences_for_issue_links_migration'
end
def down
remove_concurrent_index_by_name :vulnerability_occurrences,
:index_vulnerability_occurrences_for_issue_links_migration
end
end
5aeb0e74859df14e460b39b9f070624a02278c13b1da9393e1671b4c79635f52
\ No newline at end of file
...@@ -20849,6 +20849,8 @@ CREATE UNIQUE INDEX index_vulnerability_occurrence_identifiers_on_unique_keys ON ...@@ -20849,6 +20849,8 @@ CREATE UNIQUE INDEX index_vulnerability_occurrence_identifiers_on_unique_keys ON
CREATE INDEX index_vulnerability_occurrence_pipelines_on_pipeline_id ON public.vulnerability_occurrence_pipelines USING btree (pipeline_id); CREATE INDEX index_vulnerability_occurrence_pipelines_on_pipeline_id ON public.vulnerability_occurrence_pipelines USING btree (pipeline_id);
CREATE INDEX index_vulnerability_occurrences_for_issue_links_migration ON public.vulnerability_occurrences USING btree (project_id, report_type, encode(project_fingerprint, 'hex'::text));
CREATE INDEX index_vulnerability_occurrences_on_primary_identifier_id ON public.vulnerability_occurrences USING btree (primary_identifier_id); CREATE INDEX index_vulnerability_occurrences_on_primary_identifier_id ON public.vulnerability_occurrences USING btree (primary_identifier_id);
CREATE INDEX index_vulnerability_occurrences_on_scanner_id ON public.vulnerability_occurrences USING btree (scanner_id); CREATE INDEX index_vulnerability_occurrences_on_scanner_id ON public.vulnerability_occurrences USING btree (scanner_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