diff options
author | Yasuo Honda <yasuo.honda@gmail.com> | 2014-09-03 02:51:27 +0900 |
---|---|---|
committer | Yasuo Honda <yasuo.honda@gmail.com> | 2014-09-03 04:43:53 +0900 |
commit | 252165ea46932f8a7304ce40ba6e30dc1b490586 (patch) | |
tree | 9c3db39472ca0b6ae51cf01865ad9fb6e3348920 /activerecord/test/cases/migration | |
parent | a2f8377d1dd66c200a9a8d31db14f2b0a4bec744 (diff) | |
download | rails-252165ea46932f8a7304ce40ba6e30dc1b490586.tar.gz rails-252165ea46932f8a7304ce40ba6e30dc1b490586.tar.bz2 rails-252165ea46932f8a7304ce40ba6e30dc1b490586.zip |
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.
Diffstat (limited to 'activerecord/test/cases/migration')
-rw-r--r-- | activerecord/test/cases/migration/foreign_key_test.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |