Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-12-11 21:10:57 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-12-11 21:10:57 +0300
commit7eeb03ce0e64c30df91665524e543fe4e611c410 (patch)
tree07cbca6dd30e8c358bca54a0494f4716ad35cd6f /db
parentd83a3edd4416e93f2815815c1be4ee0a2755a3c5 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20231206142250_sync_create_supporting_index_for_finding_id_backfill.rb25
-rw-r--r--db/schema_migrations/202312061422501
-rw-r--r--db/structure.sql2
3 files changed, 28 insertions, 0 deletions
diff --git a/db/post_migrate/20231206142250_sync_create_supporting_index_for_finding_id_backfill.rb b/db/post_migrate/20231206142250_sync_create_supporting_index_for_finding_id_backfill.rb
new file mode 100644
index 00000000000..1371674a8d9
--- /dev/null
+++ b/db/post_migrate/20231206142250_sync_create_supporting_index_for_finding_id_backfill.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+class SyncCreateSupportingIndexForFindingIdBackfill < Gitlab::Database::Migration[2.2]
+ milestone '16.7'
+
+ disable_ddl_transaction!
+
+ INDEX_NAME = "tmp_index_vulnerabilities_on_id_finding_id_empty"
+
+ def up
+ add_concurrent_index(
+ :vulnerabilities,
+ :id,
+ where: "finding_id IS NULL",
+ name: INDEX_NAME
+ )
+ end
+
+ def down
+ remove_concurrent_index_by_name(
+ :vulnerabilities,
+ INDEX_NAME
+ )
+ end
+end
diff --git a/db/schema_migrations/20231206142250 b/db/schema_migrations/20231206142250
new file mode 100644
index 00000000000..547e11e29fd
--- /dev/null
+++ b/db/schema_migrations/20231206142250
@@ -0,0 +1 @@
+4d8f16d926fc141a72a9d25f200dfe345f3bb4cff3cd8c71f4b4792df445119c \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 4f1aef9a8d0..a8cd3824d84 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -35361,6 +35361,8 @@ CREATE INDEX tmp_index_project_statistics_cont_registry_size ON project_statisti
CREATE INDEX tmp_index_project_statistics_updated_at ON project_statistics USING btree (project_id, updated_at) WHERE (repository_size > 0);
+CREATE INDEX tmp_index_vulnerabilities_on_id_finding_id_empty ON vulnerabilities USING btree (id) WHERE (finding_id IS NULL);
+
CREATE INDEX tmp_index_vulnerability_dismissal_info ON vulnerabilities USING btree (id) WHERE ((state = 2) AND ((dismissed_at IS NULL) OR (dismissed_by_id IS NULL)));
CREATE INDEX tmp_index_vulnerability_overlong_title_html ON vulnerabilities USING btree (id) WHERE (length(title_html) > 800);