aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration
diff options
context:
space:
mode:
authorYasuo Honda <yasuo.honda@gmail.com>2015-01-21 02:46:07 +0000
committerYasuo Honda <yasuo.honda@gmail.com>2015-01-21 16:17:34 +0000
commited3c38c7aa2653ddba67ad12926ac158fbdf6c32 (patch)
treef80e14398c2882be845431b106259e1b06ded860 /activerecord/test/cases/migration
parentbe9b68038e83a617eb38c26147659162e4ac3d2c (diff)
downloadrails-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/migration')
-rw-r--r--activerecord/test/cases/migration/references_foreign_key_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/migration/references_foreign_key_test.rb b/activerecord/test/cases/migration/references_foreign_key_test.rb
index bba8897a0d..99de7db70c 100644
--- a/activerecord/test/cases/migration/references_foreign_key_test.rb
+++ b/activerecord/test/cases/migration/references_foreign_key_test.rb
@@ -10,8 +10,8 @@ module ActiveRecord
end
teardown do
- @connection.execute("drop table if exists testings")
- @connection.execute("drop table if exists testing_parents")
+ @connection.drop_table("testings") if @connection.table_exists? "testings"
+ @connection.drop_table("testing_parents") if @connection.table_exists? "testing_parents"
end
test "foreign keys can be created with the table" do