diff options
author | Tarmo Tänav <tarmo@itech.ee> | 2008-05-07 02:08:57 +0300 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-05-07 13:01:46 +1200 |
commit | 0a21193dc660396fb993b06d1d3c168a9cd900a5 (patch) | |
tree | 2e1cff75eefe09a019bd25f3bbec9975ffb8c032 /activerecord/lib | |
parent | 8877ab5852d9a1133eb9a730ae47dde214bafe55 (diff) | |
download | rails-0a21193dc660396fb993b06d1d3c168a9cd900a5.tar.gz rails-0a21193dc660396fb993b06d1d3c168a9cd900a5.tar.bz2 rails-0a21193dc660396fb993b06d1d3c168a9cd900a5.zip |
create_table :force => true no longer tries to drop a non-existing table
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index e2b8896d42..1594be40e2 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -97,8 +97,8 @@ module ActiveRecord yield table_definition - if options[:force] - drop_table(table_name, options) rescue nil + if options[:force] && table_exists?(table_name) + drop_table(table_name, options) end create_sql = "CREATE#{' TEMPORARY' if options[:temporary]} TABLE " |