diff options
author | eileencodes <eileencodes@gmail.com> | 2018-04-06 09:59:16 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2018-04-09 13:08:00 -0400 |
commit | 48d58494dbfaab759531c168f0103542e4f73614 (patch) | |
tree | e2b36a3421681390ded85785eed1eda6490d8c45 | |
parent | ab43b5405ea2b7db1b768e56fc56eaf0ee796f29 (diff) | |
download | rails-48d58494dbfaab759531c168f0103542e4f73614.tar.gz rails-48d58494dbfaab759531c168f0103542e4f73614.tar.bz2 rails-48d58494dbfaab759531c168f0103542e4f73614.zip |
Allow schema/structure load for multiple databases
Pass the spec name to load_schema in order to load from the correct
structure file when there are multiple databases
-rw-r--r-- | activerecord/lib/active_record/tasks/database_tasks.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/tasks/database_tasks.rb b/activerecord/lib/active_record/tasks/database_tasks.rb index 5787660148..0b26c720f7 100644 --- a/activerecord/lib/active_record/tasks/database_tasks.rb +++ b/activerecord/lib/active_record/tasks/database_tasks.rb @@ -240,8 +240,8 @@ module ActiveRecord class_for_adapter(configuration["adapter"]).new(*arguments).structure_load(filename, structure_load_flags) end - def load_schema(configuration, format = ActiveRecord::Base.schema_format, file = nil, environment = env) # :nodoc: - file ||= schema_file(format) + def load_schema(configuration, format = ActiveRecord::Base.schema_format, file = nil, environment = env, spec_name = "primary") # :nodoc: + file ||= dump_filename(spec_name, format) check_schema_file(file) ActiveRecord::Base.establish_connection(configuration) @@ -283,7 +283,7 @@ module ActiveRecord def load_schema_current(format = ActiveRecord::Base.schema_format, file = nil, environment = env) each_current_configuration(environment) { |configuration, spec_name, env| - load_schema configuration, format, file, env + load_schema(configuration, format, file, env, spec_name) } ActiveRecord::Base.establish_connection(environment.to_sym) end |