From 0a21193dc660396fb993b06d1d3c168a9cd900a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarmo=20T=C3=A4nav?= Date: Wed, 7 May 2008 02:08:57 +0300 Subject: create_table :force => true no longer tries to drop a non-existing table Signed-off-by: Michael Koziarski --- .../active_record/connection_adapters/abstract/schema_statements.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib/active_record') 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 " -- cgit v1.2.3