Skip to content

Commit

Permalink
Ensure db:drop:all doesn't error out on exception [#2997 state:resolv…
Browse files Browse the repository at this point in the history
…ed] [Anthony Caliendo]
  • Loading branch information
lifo committed Aug 8, 2009
1 parent 7f84f14 commit ed8a0a1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions railties/lib/tasks/databases.rake
Expand Up @@ -101,8 +101,12 @@ namespace :db do
ActiveRecord::Base.configurations.each_value do |config|
# Skip entries that don't have a database key
next unless config['database']
# Only connect to local databases
local_database?(config) { drop_database(config) }
begin
# Only connect to local databases
local_database?(config) { drop_database(config) }
rescue Exception => e
puts "Couldn't drop #{config['database']} : #{e.inspect}"
end
end
end
end
Expand Down

0 comments on commit ed8a0a1

Please sign in to comment.