Merge pull request #46268 from eileencodes/cleanup-check-pending

Cleanup check pending
This commit is contained in:
Eileen M. Uchitelle 2022-10-18 14:23:56 -04:00 committed by GitHub
commit e1e1620e84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -638,9 +638,7 @@ def check_pending!(connection = Base.connection)
end
def load_schema_if_pending!
all_configs = db_configs_in_current_env
needs_update = !all_configs.all? do |db_config|
needs_update = !db_configs_in_current_env.all? do |db_config|
Tasks::DatabaseTasks.schema_up_to_date?(db_config, ActiveRecord.schema_format)
end
@ -653,7 +651,7 @@ def load_schema_if_pending!
end
end
check_pending_migrations(db_configs: all_configs)
check_pending_migrations
end
def maintain_test_schema! # :nodoc:
@ -679,9 +677,10 @@ def disable_ddl_transaction!
@disable_ddl_transaction = true
end
def check_pending_migrations(db_configs: db_configs_in_current_env) # :nodoc:
def check_pending_migrations # :nodoc:
prev_db_config = Base.connection_db_config
db_configs.each do |db_config|
db_configs_in_current_env.each do |db_config|
Base.establish_connection(db_config)
check_pending!
end