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-05-22 06:07:38 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-22 06:07:38 +0300
commit598b0e97df747c943cff27e2bdd426c959073e07 (patch)
treed43e696885c1831625a088be1a551ec7c0240b9d /db
parent0a692e1e299b3b5c3440c7f6eb0767b33300e34e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20230426030342_index_system_note_metadata_on_id_for_relate_and_unrelate_actions.rb19
-rw-r--r--db/schema_migrations/202304260303421
-rw-r--r--db/structure.sql2
3 files changed, 22 insertions, 0 deletions
diff --git a/db/post_migrate/20230426030342_index_system_note_metadata_on_id_for_relate_and_unrelate_actions.rb b/db/post_migrate/20230426030342_index_system_note_metadata_on_id_for_relate_and_unrelate_actions.rb
new file mode 100644
index 00000000000..2b21a25311f
--- /dev/null
+++ b/db/post_migrate/20230426030342_index_system_note_metadata_on_id_for_relate_and_unrelate_actions.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class IndexSystemNoteMetadataOnIdForRelateAndUnrelateActions < Gitlab::Database::Migration[2.1]
+ INDEX_NAME = 'tmp_index_for_backfilling_resource_link_events'
+ CONDITION = "action='relate_to_parent' OR action='unrelate_from_parent'"
+
+ disable_ddl_transaction!
+
+ def up
+ # Temporary index to be removed in https://gitlab.com/gitlab-org/gitlab/-/issues/408797
+ add_concurrent_index :system_note_metadata, :id,
+ where: CONDITION,
+ name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :system_note_metadata, INDEX_NAME
+ end
+end
diff --git a/db/schema_migrations/20230426030342 b/db/schema_migrations/20230426030342
new file mode 100644
index 00000000000..08f6ed3d81a
--- /dev/null
+++ b/db/schema_migrations/20230426030342
@@ -0,0 +1 @@
+54267e34c6978456efca6c784c4e4ea7541dac98a704095a9766809725021bb8 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index c14dd28fe31..d1132f0066f 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -33164,6 +33164,8 @@ CREATE INDEX tmp_index_container_repos_on_non_migrated ON container_repositories
CREATE INDEX tmp_index_container_repositories_on_id_migration_state ON container_repositories USING btree (id, migration_state);
+CREATE INDEX tmp_index_for_backfilling_resource_link_events ON system_note_metadata USING btree (id) WHERE (((action)::text = 'relate_to_parent'::text) OR ((action)::text = 'unrelate_from_parent'::text));
+
CREATE INDEX tmp_index_for_null_member_namespace_id ON members USING btree (member_namespace_id) WHERE (member_namespace_id IS NULL);
CREATE INDEX tmp_index_for_project_namespace_id_migration_on_routes ON routes USING btree (id) WHERE ((namespace_id IS NULL) AND ((source_type)::text = 'Project'::text));