diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-08 09:08:49 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-08 09:08:49 +0300 |
commit | 208f195a9bc3614e3c720d6e485830d37c4f49df (patch) | |
tree | e3fe98a5debe6147a29a244d5e8f2e9096264c56 /db | |
parent | bf293d47937b3332462689c3fecc868706553f3a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
8 files changed, 54 insertions, 2 deletions
diff --git a/db/post_migrate/20230516172446_prepare_issues_work_item_type_id_project_id_index.rb b/db/post_migrate/20230516172446_prepare_issues_work_item_type_id_project_id_index.rb index e5e4e47c073..45f00e8292d 100644 --- a/db/post_migrate/20230516172446_prepare_issues_work_item_type_id_project_id_index.rb +++ b/db/post_migrate/20230516172446_prepare_issues_work_item_type_id_project_id_index.rb @@ -3,7 +3,7 @@ class PrepareIssuesWorkItemTypeIdProjectIdIndex < Gitlab::Database::Migration[2.1] INDEX_NAME = 'index_issues_on_work_item_type_id_project_id_created_at_state' - # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120520 + # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/121297 def up prepare_async_index :issues, [:work_item_type_id, :project_id, :created_at, :state_id], name: INDEX_NAME end diff --git a/db/post_migrate/20230516192543_add_issues_work_item_type_id_project_id_index.rb b/db/post_migrate/20230516192543_add_issues_work_item_type_id_project_id_index.rb new file mode 100644 index 00000000000..2ae226bd85f --- /dev/null +++ b/db/post_migrate/20230516192543_add_issues_work_item_type_id_project_id_index.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIssuesWorkItemTypeIdProjectIdIndex < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_issues_on_work_item_type_id_project_id_created_at_state' + + disable_ddl_transaction! + + def up + add_concurrent_index :issues, [:work_item_type_id, :project_id, :created_at, :state_id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :issues, INDEX_NAME + end +end diff --git a/db/post_migrate/20230531165731_drop_index_issues_on_work_item_type_id.rb b/db/post_migrate/20230531165731_drop_index_issues_on_work_item_type_id.rb new file mode 100644 index 00000000000..d200aecea65 --- /dev/null +++ b/db/post_migrate/20230531165731_drop_index_issues_on_work_item_type_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class DropIndexIssuesOnWorkItemTypeId < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_issues_on_work_item_type_id' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :issues, INDEX_NAME + end + + def down + add_concurrent_index :issues, :work_item_type_id, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230606193037_create_index_alert_management_alerts_on_created_at_project_id_with_issue.rb b/db/post_migrate/20230606193037_create_index_alert_management_alerts_on_created_at_project_id_with_issue.rb new file mode 100644 index 00000000000..3038193e949 --- /dev/null +++ b/db/post_migrate/20230606193037_create_index_alert_management_alerts_on_created_at_project_id_with_issue.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CreateIndexAlertManagementAlertsOnCreatedAtProjectIdWithIssue < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'idx_alert_management_alerts_on_created_at_project_id_with_issue' + + disable_ddl_transaction! + + def up + add_concurrent_index :alert_management_alerts, [:created_at, :project_id], + where: 'issue_id IS NOT NULL', + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :alert_management_alerts, INDEX_NAME + end +end diff --git a/db/schema_migrations/20230516192543 b/db/schema_migrations/20230516192543 new file mode 100644 index 00000000000..e7137fd2448 --- /dev/null +++ b/db/schema_migrations/20230516192543 @@ -0,0 +1 @@ +0565e50d50fa969c55f276f105e389819830591223aea399340a5288ef4618ee
\ No newline at end of file diff --git a/db/schema_migrations/20230531165731 b/db/schema_migrations/20230531165731 new file mode 100644 index 00000000000..6463d3cf3b3 --- /dev/null +++ b/db/schema_migrations/20230531165731 @@ -0,0 +1 @@ +83ec5273ae18c7dc8f554373df9c09e5b771912d5f093f455dd1e919a680e6ca
\ No newline at end of file diff --git a/db/schema_migrations/20230606193037 b/db/schema_migrations/20230606193037 new file mode 100644 index 00000000000..181a1a89ef9 --- /dev/null +++ b/db/schema_migrations/20230606193037 @@ -0,0 +1 @@ +0537c5c23fc1a7e65780157a9bc4ee8db8a5d064779832c699222c5ab2e6e0eb
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index d454f9d06cd..d106f3f7064 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -29781,6 +29781,8 @@ CREATE UNIQUE INDEX i_pm_package_versions_on_package_id_and_version ON pm_packag CREATE UNIQUE INDEX i_pm_packages_purl_type_and_name ON pm_packages USING btree (purl_type, name); +CREATE INDEX idx_alert_management_alerts_on_created_at_project_id_with_issue ON alert_management_alerts USING btree (created_at, project_id) WHERE (issue_id IS NOT NULL); + CREATE INDEX idx_analytics_devops_adoption_segments_on_namespace_id ON analytics_devops_adoption_segments USING btree (namespace_id); CREATE INDEX idx_analytics_devops_adoption_snapshots_finalized ON analytics_devops_adoption_snapshots USING btree (namespace_id, end_time) WHERE (recorded_at >= end_time); @@ -31527,7 +31529,7 @@ CREATE INDEX index_issues_on_updated_at ON issues USING btree (updated_at); CREATE INDEX index_issues_on_updated_by_id ON issues USING btree (updated_by_id) WHERE (updated_by_id IS NOT NULL); -CREATE INDEX index_issues_on_work_item_type_id ON issues USING btree (work_item_type_id); +CREATE INDEX index_issues_on_work_item_type_id_project_id_created_at_state ON issues USING btree (work_item_type_id, project_id, created_at, state_id); CREATE INDEX index_iterations_cadences_on_group_id ON iterations_cadences USING btree (group_id); |