diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-13 09:15:43 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-13 09:15:43 +0300 |
commit | 4a60d08bd5debb3678e939988633a2ba04a758c7 (patch) | |
tree | c1907cd486fc361cf11fafe8ca7de29fe65ab99a /db | |
parent | b9abe8515111c39c65321258d760aaf4773cb55f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20230405094230_create_index_for_override_uuids_logic_on_vulnerability_occurrences.rb | 17 | ||||
-rw-r--r-- | db/schema_migrations/20230405094230 | 1 | ||||
-rw-r--r-- | db/structure.sql | 2 |
3 files changed, 20 insertions, 0 deletions
diff --git a/db/post_migrate/20230405094230_create_index_for_override_uuids_logic_on_vulnerability_occurrences.rb b/db/post_migrate/20230405094230_create_index_for_override_uuids_logic_on_vulnerability_occurrences.rb new file mode 100644 index 00000000000..fd6620d77fe --- /dev/null +++ b/db/post_migrate/20230405094230_create_index_for_override_uuids_logic_on_vulnerability_occurrences.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CreateIndexForOverrideUuidsLogicOnVulnerabilityOccurrences < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_vulnerability_occurrences_for_override_uuids_logic' + + def up + add_concurrent_index :vulnerability_occurrences, + [:project_id, :report_type, :location_fingerprint], + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME + end +end diff --git a/db/schema_migrations/20230405094230 b/db/schema_migrations/20230405094230 new file mode 100644 index 00000000000..2af4c0d876f --- /dev/null +++ b/db/schema_migrations/20230405094230 @@ -0,0 +1 @@ +6b9ded39763a59b0047e256b9283084b4f05dbca46de85e7c8bb6c7d44d96d23
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 6b7322ad2f5..4a656b18fec 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -32593,6 +32593,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_for_override_uuids_logic ON vulnerability_occurrences USING btree (project_id, report_type, location_fingerprint); + 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_location_k8s_agent_id ON vulnerability_occurrences USING gin ((((location -> 'kubernetes_resource'::text) -> 'agent_id'::text))) WHERE (report_type = 7); |