aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration_test.rb
diff options
context:
space:
mode:
authorAndrew White <pixeltrix@users.noreply.github.com>2017-01-19 16:33:21 +0000
committerGitHub <noreply@github.com>2017-01-19 16:33:21 +0000
commit04bf257195b2966e4b998fa4278efb3629673d46 (patch)
tree2fe4712678862cfc48b76fd4129ce416636de47a /activerecord/test/cases/migration_test.rb
parent9a1f4bcf9c7bcb1fb19af9668d168d0356caab9a (diff)
parent7674df550b0cde7f18b3d70967f0cb3ac61ae244 (diff)
downloadrails-04bf257195b2966e4b998fa4278efb3629673d46.tar.gz
rails-04bf257195b2966e4b998fa4278efb3629673d46.tar.bz2
rails-04bf257195b2966e4b998fa4278efb3629673d46.zip
Merge pull request #27740 from kamipo/deprecate_internal_methods
Deprecate `initialize_schema_migrations_table` and `initialize_internal_metadata_table`
Diffstat (limited to 'activerecord/test/cases/migration_test.rb')
-rw-r--r--activerecord/test/cases/migration_test.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index 4edb807bbb..2fda4d60b8 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -43,10 +43,10 @@ class MigrationTest < ActiveRecord::TestCase
ActiveRecord::Base.table_name_prefix = ""
ActiveRecord::Base.table_name_suffix = ""
- ActiveRecord::Base.connection.initialize_schema_migrations_table
- ActiveRecord::Base.connection.execute "DELETE FROM #{ActiveRecord::Migrator.schema_migrations_table_name}"
+ ActiveRecord::SchemaMigration.create_table
+ ActiveRecord::SchemaMigration.delete_all
- %w(things awesome_things prefix_things_suffix p_awesome_things_s ).each do |table|
+ %w(things awesome_things prefix_things_suffix p_awesome_things_s).each do |table|
Thing.connection.drop_table(table) rescue nil
end
Thing.reset_column_information
@@ -916,7 +916,6 @@ if ActiveRecord::Base.connection.supports_bulk_alter?
@indexes ||= Person.connection.indexes("delete_me")
end
end # AlterTableMigrationsTest
-
end
class CopyMigrationsTest < ActiveRecord::TestCase
@@ -1134,4 +1133,9 @@ class CopyMigrationsTest < ActiveRecord::TestCase
def test_unknown_migration_version_should_raise_an_argument_error
assert_raise(ArgumentError) { ActiveRecord::Migration[1.0] }
end
+
+ def test_deprecate_initialize_internal_tables
+ assert_deprecated { ActiveRecord::Base.connection.initialize_schema_migrations_table }
+ assert_deprecated { ActiveRecord::Base.connection.initialize_internal_metadata_table }
+ end
end