2020-07-14 20:09:23 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-09-16 14:11:32 -04:00
|
|
|
Gitlab::Database::Partitioning.register_models([
|
|
|
|
AuditEvent,
|
2021-12-10 10:10:24 -05:00
|
|
|
WebHookLog,
|
2022-01-29 07:14:23 -05:00
|
|
|
LooseForeignKeys::DeletedRecord,
|
|
|
|
Gitlab::Database::BackgroundMigration::BatchedJobTransitionLog
|
2021-09-16 14:11:32 -04:00
|
|
|
])
|
2020-07-22 17:09:50 -04:00
|
|
|
|
2021-06-30 17:07:26 -04:00
|
|
|
if Gitlab.ee?
|
2021-09-16 14:11:32 -04:00
|
|
|
Gitlab::Database::Partitioning.register_models([
|
|
|
|
IncidentManagement::PendingEscalations::Alert,
|
|
|
|
IncidentManagement::PendingEscalations::Issue
|
|
|
|
])
|
2021-10-27 11:13:41 -04:00
|
|
|
else
|
|
|
|
Gitlab::Database::Partitioning.register_tables([
|
|
|
|
{
|
2022-02-01 13:17:05 -05:00
|
|
|
limit_connection_names: %i[main],
|
2021-10-27 11:13:41 -04:00
|
|
|
table_name: 'incident_management_pending_alert_escalations',
|
|
|
|
partitioned_column: :process_at, strategy: :monthly
|
|
|
|
},
|
|
|
|
{
|
2022-02-01 13:17:05 -05:00
|
|
|
limit_connection_names: %i[main],
|
2021-10-27 11:13:41 -04:00
|
|
|
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:
|
2022-01-25 04:12:18 -05:00
|
|
|
# https://jihulab.com/gitlab-cn/gitlab/-/blob/main-jh/jh/app/models/phone/verification_code.rb
|
2021-10-27 11:13:41 -04:00
|
|
|
{
|
2022-02-01 13:17:05 -05:00
|
|
|
limit_connection_names: %i[main],
|
2021-10-27 11:13:41 -04:00
|
|
|
table_name: 'verification_codes',
|
|
|
|
partitioned_column: :created_at, strategy: :monthly
|
|
|
|
}
|
|
|
|
])
|
2021-06-30 17:07:26 -04:00
|
|
|
end
|
|
|
|
|
2021-11-10 13:12:35 -05:00
|
|
|
Gitlab::Database::Partitioning.sync_partitions_ignore_db_error
|