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,
|
|
|
|
WebHookLog,
|
|
|
|
LooseForeignKeys::DeletedRecord
|
|
|
|
])
|
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-06-30 17:07:26 -04:00
|
|
|
end
|
|
|
|
|
2020-07-14 20:09:23 -04:00
|
|
|
begin
|
2021-09-16 14:11:32 -04:00
|
|
|
Gitlab::Database::Partitioning.sync_partitions unless ENV['DISABLE_POSTGRES_PARTITION_CREATION_ON_STARTUP']
|
2020-07-14 20:09:23 -04:00
|
|
|
rescue ActiveRecord::ActiveRecordError, PG::Error
|
|
|
|
# ignore - happens when Rake tasks yet have to create a database, e.g. for testing
|
|
|
|
end
|