From 2ee8419813b643f92344097d1c8460f045967480 Mon Sep 17 00:00:00 2001 From: Kenn Ejima Date: Fri, 25 Jul 2014 11:40:28 -0700 Subject: No verbose backtrace by db:drop when database does not exist. --- activerecord/CHANGELOG.md | 6 ++++++ activerecord/lib/active_record/tasks/database_tasks.rb | 2 ++ 2 files changed, 8 insertions(+) (limited to 'activerecord') 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']}" -- cgit v1.2.3