Remove MigrationContext deprecation in 7.1

DEPRECATION WARNING: SchemaMigration no longer inherits from
ActiveRecord::Base. If you want to use the default connection, remove
this argument. If you want to use a specific connection, instantiate
MigrationContext with the connection's schema migration, for example
`MigrationContext.new(path, Dog.connection.schema_migration)`.
This commit is contained in:
Étienne Barrié
2023-06-08 11:46:18 +02:00
parent c809adeeed
commit 48e115334b

View File

@@ -5,7 +5,9 @@ ActiveRecord::Base.logger = Logger.new(nil)
ActiveRecord::Base.include_root_in_json = true
migrate_path = File.expand_path("../../rails_app/db/migrate/", __FILE__)
if Devise::Test.rails6_and_up?
if Devise::Test.rails71_and_up?
ActiveRecord::MigrationContext.new(migrate_path).migrate
elsif Devise::Test.rails6_and_up?
ActiveRecord::MigrationContext.new(migrate_path, ActiveRecord::SchemaMigration).migrate
elsif Devise::Test.rails52_and_up?
ActiveRecord::MigrationContext.new(migrate_path).migrate