debian-mirror-gitlab/config/initializers/postgres_partitioning.rb

21 lines
577 B
Ruby
Raw Normal View History

2020-07-28 23:09:34 +05:30
# frozen_string_literal: true
2021-11-11 11:23:49 +05:30
Gitlab::Database::Partitioning.register_models([
AuditEvent,
WebHookLog,
LooseForeignKeys::DeletedRecord
])
2021-09-30 23:02:18 +05:30
if Gitlab.ee?
2021-11-11 11:23:49 +05:30
Gitlab::Database::Partitioning.register_models([
IncidentManagement::PendingEscalations::Alert,
IncidentManagement::PendingEscalations::Issue
])
2021-09-30 23:02:18 +05:30
end
2020-10-24 23:57:45 +05:30
2020-07-28 23:09:34 +05:30
begin
2021-11-11 11:23:49 +05:30
Gitlab::Database::Partitioning.sync_partitions unless ENV['DISABLE_POSTGRES_PARTITION_CREATION_ON_STARTUP']
2020-07-28 23:09:34 +05:30
rescue ActiveRecord::ActiveRecordError, PG::Error
# ignore - happens when Rake tasks yet have to create a database, e.g. for testing
end