diff options
author | Yasuo Honda <yasuo.honda@gmail.com> | 2015-01-21 02:46:07 +0000 |
---|---|---|
committer | Yasuo Honda <yasuo.honda@gmail.com> | 2015-01-21 16:17:34 +0000 |
commit | ed3c38c7aa2653ddba67ad12926ac158fbdf6c32 (patch) | |
tree | f80e14398c2882be845431b106259e1b06ded860 /activerecord/test/cases/primary_keys_test.rb | |
parent | be9b68038e83a617eb38c26147659162e4ac3d2c (diff) | |
download | rails-ed3c38c7aa2653ddba67ad12926ac158fbdf6c32.tar.gz rails-ed3c38c7aa2653ddba67ad12926ac158fbdf6c32.tar.bz2 rails-ed3c38c7aa2653ddba67ad12926ac158fbdf6c32.zip |
Replace `if exists` with `table_exists?` and drop table statement with `drop_table`
since 'drop table if exists' statement does not always work with some databases such as Oracle.
also Oracle drop table statement will not drop sequence objects.
Diffstat (limited to 'activerecord/test/cases/primary_keys_test.rb')
-rw-r--r-- | activerecord/test/cases/primary_keys_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/cases/primary_keys_test.rb b/activerecord/test/cases/primary_keys_test.rb index 751eccc015..4b668f84dd 100644 --- a/activerecord/test/cases/primary_keys_test.rb +++ b/activerecord/test/cases/primary_keys_test.rb @@ -210,7 +210,7 @@ class PrimaryKeyAnyTypeTest < ActiveRecord::TestCase end teardown do - @connection.execute("DROP TABLE IF EXISTS barcodes") + @connection.drop_table(:barcodes) if @connection.table_exists? :barcodes end def test_any_type_primary_key |