Commit 652e2b92 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'sk/338669-add-location-image-index' into 'master'

Create index for vulnerability_occurrences image location

See merge request gitlab-org/gitlab!70275
parents a1b4d1fe 44e892e7
# frozen_string_literal: true
class AddImageLocationIndexToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
INDEX_NAME = 'index_vulnerability_occurrences_on_location_image'
def up
add_concurrent_index :vulnerability_occurrences, "(location -> 'image')",
using: 'GIN',
where: 'report_type IN (2, 7)',
name: INDEX_NAME
end
def down
remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME
end
end
ae98a673b649faf8644990de328470579e121544d4fc417562cc64a7687550ca
\ No newline at end of file
......@@ -26809,6 +26809,8 @@ CREATE INDEX index_vulnerability_occurrences_deduplication ON vulnerability_occu
CREATE INDEX index_vulnerability_occurrences_for_issue_links_migration ON vulnerability_occurrences USING btree (project_id, report_type, encode(project_fingerprint, 'hex'::text));
CREATE INDEX index_vulnerability_occurrences_on_location_image ON vulnerability_occurrences USING gin (((location -> 'image'::text))) WHERE (report_type = ANY (ARRAY[2, 7]));
CREATE INDEX index_vulnerability_occurrences_on_primary_identifier_id ON vulnerability_occurrences USING btree (primary_identifier_id);
CREATE INDEX index_vulnerability_occurrences_on_project_fingerprint ON vulnerability_occurrences USING btree (project_fingerprint);
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