diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-04 06:28:59 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2019-04-04 06:34:26 +0900 |
commit | 2ca056be6f38e20add62bc3d370ae06a8263318b (patch) | |
tree | 7ab7be6e40618d422be85b55d83465634c0a9069 /activerecord/test/cases/adapters/postgresql | |
parent | 9d02b1bd58a20f34d36c461a0b88bfe590655b54 (diff) | |
download | rails-2ca056be6f38e20add62bc3d370ae06a8263318b.tar.gz rails-2ca056be6f38e20add62bc3d370ae06a8263318b.tar.bz2 rails-2ca056be6f38e20add62bc3d370ae06a8263318b.zip |
Ensure `reset_table_name` when table name prefix/suffix is changed
Also, `reset_column_information` is unnecessary since `reset_table_name`
does that too.
Diffstat (limited to 'activerecord/test/cases/adapters/postgresql')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/extension_migration_test.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/extension_migration_test.rb b/activerecord/test/cases/adapters/postgresql/extension_migration_test.rb index df97ab11e7..0fd7b2c6ed 100644 --- a/activerecord/test/cases/adapters/postgresql/extension_migration_test.rb +++ b/activerecord/test/cases/adapters/postgresql/extension_migration_test.rb @@ -22,23 +22,26 @@ class PostgresqlExtensionMigrationTest < ActiveRecord::PostgreSQLTestCase @connection = ActiveRecord::Base.connection - @old_schema_migration_table_name = ActiveRecord::SchemaMigration.table_name @old_table_name_prefix = ActiveRecord::Base.table_name_prefix @old_table_name_suffix = ActiveRecord::Base.table_name_suffix ActiveRecord::Base.table_name_prefix = "p_" ActiveRecord::Base.table_name_suffix = "_s" + ActiveRecord::SchemaMigration.reset_table_name + ActiveRecord::InternalMetadata.reset_table_name + ActiveRecord::SchemaMigration.delete_all rescue nil - ActiveRecord::SchemaMigration.table_name = "p_schema_migrations_s" ActiveRecord::Migration.verbose = false end def teardown - ActiveRecord::Base.table_name_prefix = @old_table_name_prefix - ActiveRecord::Base.table_name_suffix = @old_table_name_suffix ActiveRecord::SchemaMigration.delete_all rescue nil ActiveRecord::Migration.verbose = true - ActiveRecord::SchemaMigration.table_name = @old_schema_migration_table_name + + ActiveRecord::Base.table_name_prefix = @old_table_name_prefix + ActiveRecord::Base.table_name_suffix = @old_table_name_suffix + ActiveRecord::SchemaMigration.reset_table_name + ActiveRecord::InternalMetadata.reset_table_name super end |