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-10-07 11:12:00 -04:00
|
|
|
WebHookLog
|
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([
|
|
|
|
{
|
|
|
|
table_name: 'incident_management_pending_alert_escalations',
|
|
|
|
partitioned_column: :process_at, strategy: :monthly
|
|
|
|
},
|
|
|
|
{
|
|
|
|
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://gitlab.com/gitlab-jh/gitlab/-/blob/main-jh/jh/app/models/phone/verification_code.rb
|
|
|
|
{
|
|
|
|
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
|