Commit 19b78d28 authored by Adam Hegyi's avatar Adam Hegyi

Merge branch 'drop-unused-confidence-index' into 'master'

Remove unused index for confidence level migrations

See merge request gitlab-org/gitlab!33149
parents 57d0618d 74a002d7
# frozen_string_literal: true
class DropVulnerabilityConfidenceIndex < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
DOWNTIME = false
INDEX_NAME = 'index_vulnerability_on_id_and_confidence_eq_zero'
def up
Gitlab::BackgroundMigration.steal('RemoveUndefinedVulnerabilityConfidenceLevel')
remove_concurrent_index_by_name :vulnerabilities, INDEX_NAME
end
def down
add_concurrent_index(:vulnerabilities, :id, where: 'confidence = 0', name: INDEX_NAME)
end
end
# frozen_string_literal: true
class DropVulnerabilityOccurrenceConfidenceIndex < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
DOWNTIME = false
INDEX_NAME = 'index_vulnerability_occurrences_on_id_and_confidence_eq_zero'
def up
Gitlab::BackgroundMigration.steal('RemoveUndefinedOccurrenceConfidenceLevel')
remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME
end
def down
add_concurrent_index(:vulnerability_occurrences, :id, where: 'confidence = 0', name: INDEX_NAME)
end
end
......@@ -10932,8 +10932,6 @@ 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_occurrences_on_id_and_confidence_eq_zero ON public.vulnerability_occurrences USING btree (id) WHERE (confidence = 0);
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);
......@@ -10944,8 +10942,6 @@ CREATE UNIQUE INDEX index_vulnerability_occurrences_on_uuid ON public.vulnerabil
CREATE INDEX index_vulnerability_occurrences_on_vulnerability_id ON public.vulnerability_occurrences USING btree (vulnerability_id);
CREATE INDEX index_vulnerability_on_id_and_confidence_eq_zero ON public.vulnerabilities USING btree (id) WHERE (confidence = 0);
CREATE UNIQUE INDEX index_vulnerability_scanners_on_project_id_and_external_id ON public.vulnerability_scanners USING btree (project_id, external_id);
CREATE UNIQUE INDEX index_vulnerability_user_mentions_on_note_id ON public.vulnerability_user_mentions USING btree (note_id) WHERE (note_id IS NOT NULL);
......@@ -13958,5 +13954,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200526120714
20200526164946
20200526164947
20200527094322
20200527095401
\.
---
title: Remove unused index for vulnerabiliy confidence levels
merge_request: 33149
author:
type: other
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