diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /config/initializers/postgres_partitioning.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'config/initializers/postgres_partitioning.rb')
-rw-r--r-- | config/initializers/postgres_partitioning.rb | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/config/initializers/postgres_partitioning.rb b/config/initializers/postgres_partitioning.rb index 4de6e706f16..e7f29ee1a84 100644 --- a/config/initializers/postgres_partitioning.rb +++ b/config/initializers/postgres_partitioning.rb @@ -1,43 +1,48 @@ # frozen_string_literal: true -Gitlab::Database::Partitioning.register_models([ - AuditEvent, - WebHookLog, - LooseForeignKeys::DeletedRecord, - Gitlab::Database::BackgroundMigration::BatchedJobTransitionLog -]) +Gitlab::Database::Partitioning.register_models( + [ + AuditEvent, + WebHookLog, + LooseForeignKeys::DeletedRecord, + Gitlab::Database::BackgroundMigration::BatchedJobTransitionLog + ]) if Gitlab.ee? - Gitlab::Database::Partitioning.register_models([ - IncidentManagement::PendingEscalations::Alert, - IncidentManagement::PendingEscalations::Issue - ]) + Gitlab::Database::Partitioning.register_models( + [ + IncidentManagement::PendingEscalations::Alert, + IncidentManagement::PendingEscalations::Issue, + Security::Finding + ]) else - Gitlab::Database::Partitioning.register_tables([ - { - limit_connection_names: %i[main], - table_name: 'incident_management_pending_alert_escalations', - partitioned_column: :process_at, strategy: :monthly - }, - { - limit_connection_names: %i[main], - table_name: 'incident_management_pending_issue_escalations', - partitioned_column: :process_at, strategy: :monthly - } - ]) + Gitlab::Database::Partitioning.register_tables( + [ + { + limit_connection_names: %i[main], + table_name: 'incident_management_pending_alert_escalations', + partitioned_column: :process_at, strategy: :monthly + }, + { + limit_connection_names: %i[main], + table_name: 'incident_management_pending_issue_escalations', + partitioned_column: :process_at, strategy: :monthly + } + ]) end # The following tables are already defined as models unless Gitlab.jh? - Gitlab::Database::Partitioning.register_tables([ - # This should be synchronized with the following model: - # https://jihulab.com/gitlab-cn/gitlab/-/blob/main-jh/jh/app/models/phone/verification_code.rb - { - limit_connection_names: %i[main], - table_name: 'verification_codes', - partitioned_column: :created_at, strategy: :monthly - } - ]) + Gitlab::Database::Partitioning.register_tables( + [ + # This should be synchronized with the following model: + # https://jihulab.com/gitlab-cn/gitlab/-/blob/main-jh/jh/app/models/phone/verification_code.rb + { + limit_connection_names: %i[main], + table_name: 'verification_codes', + partitioned_column: :created_at, strategy: :monthly + } + ]) end Gitlab::Database::Partitioning.sync_partitions_ignore_db_error |