Merge pull request #36883 from jhawthorn/schema_sha_fix
Fix test schema loading for multi-db
This commit is contained in:
commit
646dd8c51f
@ -590,7 +590,11 @@ def load_schema_if_pending!
|
||||
current_config = Base.connection_config
|
||||
all_configs = ActiveRecord::Base.configurations.configs_for(env_name: Rails.env)
|
||||
|
||||
unless all_configs.all? { |config| Tasks::DatabaseTasks.schema_up_to_date?(config.config) }
|
||||
needs_update = !all_configs.all? do |db_config|
|
||||
Tasks::DatabaseTasks.schema_up_to_date?(db_config.config, ActiveRecord::Base.schema_format, nil, Rails.env, db_config.spec_name)
|
||||
end
|
||||
|
||||
if needs_update
|
||||
# Roundtrip to Rake to allow plugins to hook into database initialization.
|
||||
root = defined?(ENGINE_ROOT) ? ENGINE_ROOT : Rails.root
|
||||
FileUtils.cd(root) do
|
||||
|
Loading…
Reference in New Issue
Block a user