Permalink
Browse files

Fix structure:dump for multiple databases

ccea4cf broke multiple database structure:dump, the current_config line
should have been deleted instead. I'm struggling to write a test for
this since the confings are passed from rake to the structure_dump
method rather than the other way around. Hoping to come up with a test
while I work on structure:load commands for multiple databases.
  • Loading branch information...
eileencodes committed Apr 6, 2018
1 parent 475a291 commit 0a353a97869b2af256d4253533beeb38303cf753
Showing with 1 addition and 2 deletions.
  1. +1 −2 activerecord/lib/active_record/railties/databases.rake
@@ -317,8 +317,7 @@ db_namespace = namespace :db do
ActiveRecord::DatabaseConfigurations.configs_for(Rails.env) do |spec_name, config|
ActiveRecord::Base.establish_connection(config)
filename = ActiveRecord::Tasks::DatabaseTasks.dump_filename(spec_name, :sql)
current_config = ActiveRecord::Tasks::DatabaseTasks.current_config
ActiveRecord::Tasks::DatabaseTasks.structure_dump(current_config, filename)
ActiveRecord::Tasks::DatabaseTasks.structure_dump(config, filename)
if ActiveRecord::SchemaMigration.table_exists?
File.open(filename, "a") do |f|

0 comments on commit 0a353a9

Please sign in to comment.