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>2024-01-19 18:10:53 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2024-01-19 18:10:53 +0300
commit8f3a9dbb94b5a9ae4570a22bbc2a75e7572407c8 (patch)
tree0d7e5d6d5747b57a93df1181bd86a7a127c16934 /db
parent7344cec8c24f1599086498ba19096cf9918ee168 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/docs/ci_freeze_periods.yml2
-rw-r--r--db/docs/ci_resource_groups.yml2
-rw-r--r--db/docs/deploy_keys_projects.yml10
-rw-r--r--db/docs/deployments.yml15
-rw-r--r--db/docs/dora_configurations.yml10
-rw-r--r--db/docs/environments.yml15
-rw-r--r--db/docs/group_deploy_keys_groups.yml10
-rw-r--r--db/docs/group_deploy_tokens.yml10
-rw-r--r--db/docs/project_deploy_tokens.yml10
-rw-r--r--db/migrate/20240104092321_add_issue_email_participant_id_to_sent_notifications.rb9
-rw-r--r--db/migrate/20240104142200_add_index_sent_notifications_on_issue_email_participant_id.rb17
-rw-r--r--db/migrate/20240104142216_add_fk_on_sent_notifications_to_issue_email_participants.rb23
-rw-r--r--db/schema_migrations/202401040923211
-rw-r--r--db/schema_migrations/202401041422001
-rw-r--r--db/schema_migrations/202401041422161
-rw-r--r--db/structure.sql8
16 files changed, 130 insertions, 14 deletions
diff --git a/db/docs/ci_freeze_periods.yml b/db/docs/ci_freeze_periods.yml
index 0267f925149..4a64dcd44f8 100644
--- a/db/docs/ci_freeze_periods.yml
+++ b/db/docs/ci_freeze_periods.yml
@@ -8,3 +8,5 @@ description: https://docs.gitlab.com/ee/ci/environments/deployment_safety.html#p
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/29162
milestone: '13.0'
gitlab_schema: gitlab_ci
+sharding_key:
+ project_id: projects
diff --git a/db/docs/ci_resource_groups.yml b/db/docs/ci_resource_groups.yml
index ea66284ccd1..480fddb6e08 100644
--- a/db/docs/ci_resource_groups.yml
+++ b/db/docs/ci_resource_groups.yml
@@ -8,3 +8,5 @@ description: https://docs.gitlab.com/ee/ci/resource_groups/
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/20950
milestone: '12.7'
gitlab_schema: gitlab_ci
+sharding_key:
+ project_id: projects
diff --git a/db/docs/deploy_keys_projects.yml b/db/docs/deploy_keys_projects.yml
index 5d3591f1b4f..7c63d8c41e3 100644
--- a/db/docs/deploy_keys_projects.yml
+++ b/db/docs/deploy_keys_projects.yml
@@ -7,4 +7,12 @@ feature_categories:
description: https://docs.gitlab.com/ee/user/project/deploy_keys/
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/a735ce2aa7da72242629a4452c33e7a1900fdd62
milestone: "<6.0"
-gitlab_schema: gitlab_main
+gitlab_schema: gitlab_main_cell
+allow_cross_joins:
+- gitlab_main_clusterwide
+allow_cross_transactions:
+- gitlab_main_clusterwide
+allow_cross_foreign_keys:
+- gitlab_main_clusterwide
+sharding_key:
+ project_id: projects
diff --git a/db/docs/deployments.yml b/db/docs/deployments.yml
index 3fc477efced..113d0816669 100644
--- a/db/docs/deployments.yml
+++ b/db/docs/deployments.yml
@@ -4,9 +4,16 @@ classes:
- Deployment
feature_categories:
- continuous_delivery
-description: >-
- Stores metadata related to a deployment CI Build, including user, environment, status, and SHA.
- See https://docs.gitlab.com/ee/ci/environments/ for more details.
+description: Stores metadata related to a deployment CI Build, including user, environment,
+ status, and SHA. See https://docs.gitlab.com/ee/ci/environments/ for more details.
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/907c0e6796b69f9577c147dd489cf55748c749ac
milestone: '8.9'
-gitlab_schema: gitlab_main
+gitlab_schema: gitlab_main_cell
+allow_cross_joins:
+- gitlab_main_clusterwide
+allow_cross_transactions:
+- gitlab_main_clusterwide
+allow_cross_foreign_keys:
+- gitlab_main_clusterwide
+sharding_key:
+ project_id: projects
diff --git a/db/docs/dora_configurations.yml b/db/docs/dora_configurations.yml
index 63114ba6f80..6268660158a 100644
--- a/db/docs/dora_configurations.yml
+++ b/db/docs/dora_configurations.yml
@@ -7,4 +7,12 @@ feature_categories:
description: Stores project specific configurations for DORA4 calculations.
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/96561
milestone: '15.4'
-gitlab_schema: gitlab_main
+gitlab_schema: gitlab_main_cell
+allow_cross_joins:
+- gitlab_main_clusterwide
+allow_cross_transactions:
+- gitlab_main_clusterwide
+allow_cross_foreign_keys:
+- gitlab_main_clusterwide
+sharding_key:
+ project_id: projects
diff --git a/db/docs/environments.yml b/db/docs/environments.yml
index d7fcce52898..36abfc31e97 100644
--- a/db/docs/environments.yml
+++ b/db/docs/environments.yml
@@ -4,9 +4,16 @@ classes:
- Environment
feature_categories:
- continuous_delivery
-description: >-
- Project-level deployment target and metadata.
- See https://docs.gitlab.com/ee/ci/environments/ for more details.
+description: Project-level deployment target and metadata. See https://docs.gitlab.com/ee/ci/environments/
+ for more details.
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/907c0e6796b69f9577c147dd489cf55748c749ac
milestone: '8.9'
-gitlab_schema: gitlab_main
+gitlab_schema: gitlab_main_cell
+allow_cross_joins:
+- gitlab_main_clusterwide
+allow_cross_transactions:
+- gitlab_main_clusterwide
+allow_cross_foreign_keys:
+- gitlab_main_clusterwide
+sharding_key:
+ project_id: projects
diff --git a/db/docs/group_deploy_keys_groups.yml b/db/docs/group_deploy_keys_groups.yml
index 129be2af5df..615f30384b3 100644
--- a/db/docs/group_deploy_keys_groups.yml
+++ b/db/docs/group_deploy_keys_groups.yml
@@ -7,4 +7,12 @@ feature_categories:
description: https://docs.gitlab.com/ee/user/project/deploy_keys/
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/32901
milestone: '13.2'
-gitlab_schema: gitlab_main
+gitlab_schema: gitlab_main_cell
+allow_cross_joins:
+- gitlab_main_clusterwide
+allow_cross_transactions:
+- gitlab_main_clusterwide
+allow_cross_foreign_keys:
+- gitlab_main_clusterwide
+sharding_key:
+ group_id: namespaces
diff --git a/db/docs/group_deploy_tokens.yml b/db/docs/group_deploy_tokens.yml
index 450f67c57b1..bdc22d32061 100644
--- a/db/docs/group_deploy_tokens.yml
+++ b/db/docs/group_deploy_tokens.yml
@@ -7,4 +7,12 @@ feature_categories:
description: https://docs.gitlab.com/ee/user/project/deploy_tokens/
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/23460
milestone: '12.8'
-gitlab_schema: gitlab_main
+gitlab_schema: gitlab_main_cell
+allow_cross_joins:
+- gitlab_main_clusterwide
+allow_cross_transactions:
+- gitlab_main_clusterwide
+allow_cross_foreign_keys:
+- gitlab_main_clusterwide
+sharding_key:
+ group_id: namespaces
diff --git a/db/docs/project_deploy_tokens.yml b/db/docs/project_deploy_tokens.yml
index 80bca84bf4c..fe8d896ddbc 100644
--- a/db/docs/project_deploy_tokens.yml
+++ b/db/docs/project_deploy_tokens.yml
@@ -7,4 +7,12 @@ feature_categories:
description: https://docs.gitlab.com/ee/user/project/deploy_tokens/
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/8315861c9a50675b4f4f4ca536f0da90f27994f3
milestone: '10.7'
-gitlab_schema: gitlab_main
+gitlab_schema: gitlab_main_cell
+allow_cross_joins:
+- gitlab_main_clusterwide
+allow_cross_transactions:
+- gitlab_main_clusterwide
+allow_cross_foreign_keys:
+- gitlab_main_clusterwide
+sharding_key:
+ project_id: projects
diff --git a/db/migrate/20240104092321_add_issue_email_participant_id_to_sent_notifications.rb b/db/migrate/20240104092321_add_issue_email_participant_id_to_sent_notifications.rb
new file mode 100644
index 00000000000..9b5d7612b00
--- /dev/null
+++ b/db/migrate/20240104092321_add_issue_email_participant_id_to_sent_notifications.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AddIssueEmailParticipantIdToSentNotifications < Gitlab::Database::Migration[2.2]
+ milestone '16.9'
+
+ def change
+ add_column :sent_notifications, :issue_email_participant_id, :bigint, null: true
+ end
+end
diff --git a/db/migrate/20240104142200_add_index_sent_notifications_on_issue_email_participant_id.rb b/db/migrate/20240104142200_add_index_sent_notifications_on_issue_email_participant_id.rb
new file mode 100644
index 00000000000..c9b75529470
--- /dev/null
+++ b/db/migrate/20240104142200_add_index_sent_notifications_on_issue_email_participant_id.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class AddIndexSentNotificationsOnIssueEmailParticipantId < Gitlab::Database::Migration[2.2]
+ disable_ddl_transaction!
+
+ milestone '16.9'
+
+ INDEX_NAME = 'index_sent_notifications_on_issue_email_participant_id'
+
+ def up
+ add_concurrent_index :sent_notifications, :issue_email_participant_id, name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :sent_notifications, INDEX_NAME
+ end
+end
diff --git a/db/migrate/20240104142216_add_fk_on_sent_notifications_to_issue_email_participants.rb b/db/migrate/20240104142216_add_fk_on_sent_notifications_to_issue_email_participants.rb
new file mode 100644
index 00000000000..c3f1a28ded3
--- /dev/null
+++ b/db/migrate/20240104142216_add_fk_on_sent_notifications_to_issue_email_participants.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class AddFkOnSentNotificationsToIssueEmailParticipants < Gitlab::Database::Migration[2.2]
+ disable_ddl_transaction!
+
+ milestone '16.9'
+
+ def up
+ add_concurrent_foreign_key(
+ :sent_notifications,
+ :issue_email_participants,
+ column: :issue_email_participant_id,
+ on_delete: :nullify,
+ validate: false
+ )
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists :sent_notifications, column: :issue_email_participant_id
+ end
+ end
+end
diff --git a/db/schema_migrations/20240104092321 b/db/schema_migrations/20240104092321
new file mode 100644
index 00000000000..a0250e57bab
--- /dev/null
+++ b/db/schema_migrations/20240104092321
@@ -0,0 +1 @@
+947ad53db5666956141f4fe05ba0d49377720b481e88b5b9057302dc6670b1af \ No newline at end of file
diff --git a/db/schema_migrations/20240104142200 b/db/schema_migrations/20240104142200
new file mode 100644
index 00000000000..e491d148e96
--- /dev/null
+++ b/db/schema_migrations/20240104142200
@@ -0,0 +1 @@
+97d3dccf21797a0fb1077c93a85691f6c29d3ad0492da6795521bc63dae3cb56 \ No newline at end of file
diff --git a/db/schema_migrations/20240104142216 b/db/schema_migrations/20240104142216
new file mode 100644
index 00000000000..866f82e926d
--- /dev/null
+++ b/db/schema_migrations/20240104142216
@@ -0,0 +1 @@
+26d307bd716dfea4803f877182a9891dfcc4af4997f62cb91e430d7fcd7ac2c8 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 7584786bd31..14b6be62159 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -23901,7 +23901,8 @@ CREATE TABLE sent_notifications (
commit_id character varying,
reply_key character varying NOT NULL,
in_reply_to_discussion_id character varying,
- id bigint NOT NULL
+ id bigint NOT NULL,
+ issue_email_participant_id bigint
);
CREATE SEQUENCE sent_notifications_id_seq
@@ -35360,6 +35361,8 @@ CREATE UNIQUE INDEX index_security_trainings_on_unique_project_id ON security_tr
CREATE INDEX index_self_managed_prometheus_alert_events_on_environment_id ON self_managed_prometheus_alert_events USING btree (environment_id);
+CREATE INDEX index_sent_notifications_on_issue_email_participant_id ON sent_notifications USING btree (issue_email_participant_id);
+
CREATE INDEX index_sent_notifications_on_noteable_type_noteable_id ON sent_notifications USING btree (noteable_id) WHERE ((noteable_type)::text = 'Issue'::text);
CREATE UNIQUE INDEX index_sent_notifications_on_reply_key ON sent_notifications USING btree (reply_key);
@@ -38614,6 +38617,9 @@ ALTER TABLE ONLY issue_customer_relations_contacts
ALTER TABLE ONLY ssh_signatures
ADD CONSTRAINT fk_7d2f93996c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY sent_notifications
+ ADD CONSTRAINT fk_7d7663e36a FOREIGN KEY (issue_email_participant_id) REFERENCES issue_email_participants(id) ON DELETE SET NULL NOT VALID;
+
ALTER TABLE ONLY labels
ADD CONSTRAINT fk_7de4989a69 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;