2020-07-15 00:09:23 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2021-09-16 18:11:32 +00:00
|
|
|
Gitlab::Database::Partitioning.register_models([
|
|
|
|
AuditEvent,
|
2021-10-07 15:12:00 +00:00
|
|
|
WebHookLog
|
2021-09-16 18:11:32 +00:00
|
|
|
])
|
2020-07-22 21:09:50 +00:00
|
|
|
|
2021-06-30 21:07:26 +00:00
|
|
|
if Gitlab.ee?
|
2021-09-16 18:11:32 +00:00
|
|
|
Gitlab::Database::Partitioning.register_models([
|
|
|
|
IncidentManagement::PendingEscalations::Alert,
|
|
|
|
IncidentManagement::PendingEscalations::Issue
|
|
|
|
])
|
2021-06-30 21:07:26 +00:00
|
|
|
end
|
|
|
|
|
2020-07-15 00:09:23 +00:00
|
|
|
begin
|
2021-09-16 18:11:32 +00:00
|
|
|
Gitlab::Database::Partitioning.sync_partitions unless ENV['DISABLE_POSTGRES_PARTITION_CREATION_ON_STARTUP']
|
2020-07-15 00:09:23 +00:00
|
|
|
rescue ActiveRecord::ActiveRecordError, PG::Error
|
|
|
|
# ignore - happens when Rake tasks yet have to create a database, e.g. for testing
|
|
|
|
end
|