aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorKenn Ejima <kenn.ejima@gmail.com>2014-07-25 11:40:28 -0700
committerKenn Ejima <kenn.ejima@gmail.com>2014-07-27 14:34:01 -0700
commit2ee8419813b643f92344097d1c8460f045967480 (patch)
tree9abcf39fd6fae4d4187fb3eccf591bfe52a72789 /activerecord
parentdce49f83c806cf884a302b45bb69ebe1b62ad95b (diff)
downloadrails-2ee8419813b643f92344097d1c8460f045967480.tar.gz
rails-2ee8419813b643f92344097d1c8460f045967480.tar.bz2
rails-2ee8419813b643f92344097d1c8460f045967480.zip
No verbose backtrace by db:drop when database does not exist.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG.md6
-rw-r--r--activerecord/lib/active_record/tasks/database_tasks.rb2
2 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index dbb1e482fc..b679d64472 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -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:
diff --git a/activerecord/lib/active_record/tasks/database_tasks.rb b/activerecord/lib/active_record/tasks/database_tasks.rb
index 9bc23b5ec7..80186a88e3 100644
--- a/activerecord/lib/active_record/tasks/database_tasks.rb
+++ b/activerecord/lib/active_record/tasks/database_tasks.rb
@@ -110,6 +110,8 @@ module ActiveRecord
def drop(*arguments)
configuration = arguments.first
class_for_adapter(configuration['adapter']).new(*arguments).drop
+ rescue ActiveRecord::NoDatabaseError
+ $stderr.puts "#{configuration['database']} does not exist"
rescue Exception => error
$stderr.puts error, *(error.backtrace)
$stderr.puts "Couldn't drop #{configuration['database']}"