Commit e348af1d authored by Marin Jankovski's avatar Marin Jankovski

Rescue database error in application settings if the database still doesn't exist.

parent 01ab0812
......@@ -8,7 +8,7 @@ module Gitlab
else
fake_application_settings
end
rescue ActiveRecord::NoDatabaseError
rescue ActiveRecord::NoDatabaseError, database_adapter.constantize::Error
fake_application_settings
end
end
......@@ -22,5 +22,16 @@ module Gitlab
sign_in_text: Settings.extra['sign_in_text'],
)
end
# We need to check which database is setup
# but we cannot assume that the database exists already.
# Not checking this will break "rake gitlab:setup".
def database_adapter
if Rails.configuration.database_configuration[Rails.env]['adapter'] == 'mysql2'
"Mysql2"
else
"PG"
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment