1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Don't drop internal metadata tables

Some tests expects that internal metadata tables exists, and we should
not use `create_table` in transactional tests, since DDL in MySQL causes
implicit commit.

https://travis-ci.org/rails/rails/jobs/515438937#L3829
This commit is contained in:
Ryuta Kamizono 2019-04-04 09:10:17 +09:00
parent 4ecca4cd05
commit 1f235a69a3

View file

@ -50,7 +50,6 @@ module ActiveRecord
protected_environments = ActiveRecord::Base.protected_environments
current_env = ActiveRecord::Base.connection.migration_context.current_environment
InternalMetadata.create_table
InternalMetadata[:environment] = current_env
assert_called_on_instance_of(
@ -77,7 +76,6 @@ module ActiveRecord
protected_environments = ActiveRecord::Base.protected_environments
current_env = ActiveRecord::Base.connection.migration_context.current_environment
InternalMetadata.create_table
InternalMetadata[:environment] = current_env
assert_called_on_instance_of(
@ -966,8 +964,8 @@ module ActiveRecord
end
def teardown
SchemaMigration.drop_table
InternalMetadata.drop_table
SchemaMigration.delete_all
InternalMetadata.delete_all
ActiveRecord::Base.connection_handlers = { writing: ActiveRecord::Base.default_connection_handler }
end