diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-07-28 10:40:58 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-07-28 10:42:58 -0300 |
commit | 7bd0af42d6f8541a8247a89e07396c2da159d85d (patch) | |
tree | 32d9c3e27dff487e609fab73e4c8f19eec9e913d /activerecord | |
parent | 473819985a3c2ae54386fc8149e72c2b1a23a887 (diff) | |
parent | 2ee8419813b643f92344097d1c8460f045967480 (diff) | |
download | rails-7bd0af42d6f8541a8247a89e07396c2da159d85d.tar.gz rails-7bd0af42d6f8541a8247a89e07396c2da159d85d.tar.bz2 rails-7bd0af42d6f8541a8247a89e07396c2da159d85d.zip |
Merge pull request #16295 from kenn/no_stacktrace_drop_task
No verbose backtrace by db:drop when database does not exist.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/CHANGELOG.md | 6 | ||||
-rw-r--r-- | activerecord/lib/active_record/tasks/database_tasks.rb | 2 |
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..b7315ed4b3 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 "Database '#{configuration['database']}' does not exist" rescue Exception => error $stderr.puts error, *(error.backtrace) $stderr.puts "Couldn't drop #{configuration['database']}" |