Permalink
Browse files

Merge pull request #16295 from kenn/no_stacktrace_drop_task

No verbose backtrace by db:drop when database does not exist.
  • Loading branch information...
2 parents 4738199 + 2ee8419 commit 7bd0af42d6f8541a8247a89e07396c2da159d85d @rafaelfranca rafaelfranca committed Jul 28, 2014
Showing with 8 additions and 0 deletions.
  1. +6 −0 activerecord/CHANGELOG.md
  2. +2 −0 activerecord/lib/active_record/tasks/database_tasks.rb
@@ -1,3 +1,9 @@
+* No verbose backtrace by db:drop when database does not exist.
+
+ Fixes #16295.
+
+ *Kenn Ejima*
+
* Add support for Postgresql JSONB.
Example:
@@ -110,6 +110,8 @@ def create_current(environment = env)
def drop(*arguments)
configuration = arguments.first
class_for_adapter(configuration['adapter']).new(*arguments).drop
+ rescue ActiveRecord::NoDatabaseError
+ $stderr.puts "Database '#{configuration['database']}' does not exist"
rescue Exception => error
$stderr.puts error, *(error.backtrace)
$stderr.puts "Couldn't drop #{configuration['database']}"

0 comments on commit 7bd0af4

Please sign in to comment.