1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/test
eileencodes 7cc27d749c Move SchemaMigration to migration_context
This PR moves the `schema_migration` to `migration_context` so that we
can access the `schema_migration` per connection.

This does not change behavior of the SchemaMigration if you are using
one database. This also does not change behavior of any public APIs.
`Migrator` is private as is `MigrationContext` so we can change these as
needed.

We now need to pass a `schema_migration` to `Migrator` so that we can
run migrations on the right connection outside the context of a rake
task.

The bugs this fixes were discovered while debugging the issues around
the SchemaCache on initialization with multiple database. It was clear
that `get_all_versions` wouldn't work without these changes outside the
context of a rake task (because in the rake task we establish a
connection and change AR::Base.connection to the db we're running on).

Because the `SchemaCache` relies on the `SchemaMigration` information we
need to make sure we store it per-connection rather than on
ActiveRecord::Base.

[Eileen M. Uchitelle & Aaron Patterson]
2019-06-14 11:15:08 -04:00
..
application Move SchemaMigration to migration_context 2019-06-14 11:15:08 -04:00
command Fix deeply nested namespace command printing 2019-01-24 12:28:43 -05:00
commands Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
configuration Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
engine
fixtures/lib
generators Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
isolation Fixed db:prepare task for multiple databases. 2019-06-05 12:17:02 +02:00
minitest
railties Move SchemaMigration to migration_context 2019-06-14 11:15:08 -04:00
test_unit
abstract_unit.rb Output junit format test report 2019-04-04 14:34:46 +09:00
app_loader_test.rb
backtrace_cleaner_test.rb Find query_source_location using lazy Enumerator 2019-04-15 16:13:06 -07:00
code_statistics_calculator_test.rb
code_statistics_test.rb
console_helpers.rb
engine_test.rb
env_helpers.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
generators_test.rb
initializable_test.rb
json_params_parsing_test.rb
path_generation_test.rb Remove deprecated config.secret_token 2019-01-17 16:08:34 -05:00
paths_test.rb
rack_logger_test.rb
rails_info_controller_test.rb Fix secret_key_base for Railties 2019-03-13 16:41:29 -04:00
rails_info_test.rb Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json" 2019-01-08 22:21:20 +01:00
secrets_test.rb
version_test.rb