summaryrefslogtreecommitdiff
path: root/config/application.rb
diff options
context:
space:
mode:
Diffstat (limited to 'config/application.rb')
-rw-r--r--config/application.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/config/application.rb b/config/application.rb
index 06a5a726d92..2349de4892f 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -31,9 +31,18 @@ module Gitlab
require_dependency Rails.root.join('lib/gitlab/middleware/handle_malformed_strings')
require_dependency Rails.root.join('lib/gitlab/middleware/rack_multipart_tempfile_factory')
require_dependency Rails.root.join('lib/gitlab/runtime')
+ require_dependency Rails.root.join('lib/gitlab/patch/legacy_database_config')
config.autoloader = :zeitwerk
+ # To be removed in 15.0
+ # This preload is needed to convert legacy `database.yml`
+ # from `production: adapter: postgresql`
+ # into a `production: main: adapter: postgresql`
+ unless Gitlab::Utils.to_boolean(ENV['SKIP_DATABASE_CONFIG_VALIDATION'], default: false)
+ config.class.prepend(::Gitlab::Patch::LegacyDatabaseConfig)
+ end
+
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.