Skip to content

Commit 1f235a6

Browse files
committed
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
1 parent 4ecca4c commit 1f235a6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

activerecord/test/cases/tasks/database_tasks_test.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def test_raises_an_error_when_called_with_protected_environment
5050
protected_environments = ActiveRecord::Base.protected_environments
5151
current_env = ActiveRecord::Base.connection.migration_context.current_environment
5252

53-
InternalMetadata.create_table
5453
InternalMetadata[:environment] = current_env
5554

5655
assert_called_on_instance_of(
@@ -77,7 +76,6 @@ def test_raises_an_error_when_called_with_protected_environment_which_name_is_a_
7776
protected_environments = ActiveRecord::Base.protected_environments
7877
current_env = ActiveRecord::Base.connection.migration_context.current_environment
7978

80-
InternalMetadata.create_table
8179
InternalMetadata[:environment] = current_env
8280

8381
assert_called_on_instance_of(
@@ -966,8 +964,8 @@ def setup
966964
end
967965

968966
def teardown
969-
SchemaMigration.drop_table
970-
InternalMetadata.drop_table
967+
SchemaMigration.delete_all
968+
InternalMetadata.delete_all
971969
ActiveRecord::Base.connection_handlers = { writing: ActiveRecord::Base.default_connection_handler }
972970
end
973971

0 commit comments

Comments
 (0)