diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2019-06-14 14:17:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-14 14:17:49 -0400 |
commit | f813119aeca22a87adc68a4843edd7fa8a28272a (patch) | |
tree | 679421d4e547e82444d92539e90e2f5f6db0ccba /activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | |
parent | c2847716913d3fb72fd423009be1d4f124e4aa94 (diff) | |
parent | 7cc27d749c3563e6b278ad01d233cb92ea3b7935 (diff) | |
download | rails-f813119aeca22a87adc68a4843edd7fa8a28272a.tar.gz rails-f813119aeca22a87adc68a4843edd7fa8a28272a.tar.bz2 rails-f813119aeca22a87adc68a4843edd7fa8a28272a.zip |
Merge pull request #36439 from eileencodes/move-schema-migration-to-migration-context
Move SchemaMigration to migration_context
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract_adapter.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index cfd986ebf9..7d3ec7ecfd 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -163,7 +163,22 @@ module ActiveRecord end def migration_context # :nodoc: - MigrationContext.new(migrations_paths) + MigrationContext.new(migrations_paths, schema_migration) + end + + def schema_migration # :nodoc: + @schema_migration ||= begin + conn = self + spec_name = conn.pool.spec.name + name = "#{spec_name}::SchemaMigration" + + Class.new(ActiveRecord::SchemaMigration) do + define_singleton_method(:name) { name } + define_singleton_method(:to_s) { name } + + self.connection_specification_name = spec_name + end + end end class Version |