From 252165ea46932f8a7304ce40ba6e30dc1b490586 Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Wed, 3 Sep 2014 02:51:27 +0900 Subject: Remove 'if exists' from drop table statement then use `table_exists?` Since 'drop table if exists' statement does not always work with some databases such as Oracle. --- activerecord/test/cases/migration/foreign_key_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/test/cases/migration') diff --git a/activerecord/test/cases/migration/foreign_key_test.rb b/activerecord/test/cases/migration/foreign_key_test.rb index c985092b4c..ba28d55e4c 100644 --- a/activerecord/test/cases/migration/foreign_key_test.rb +++ b/activerecord/test/cases/migration/foreign_key_test.rb @@ -29,8 +29,8 @@ module ActiveRecord teardown do if defined?(@connection) - @connection.execute "DROP TABLE IF EXISTS astronauts" - @connection.execute "DROP TABLE IF EXISTS rockets" + @connection.execute "DROP TABLE astronauts" if @connection.table_exists? 'astronauts' + @connection.execute "DROP TABLE rockets" if @connection.table_exists? 'rockets' end end -- cgit v1.2.3