diff options
author | bogdanvlviv <bogdanvlviv@gmail.com> | 2016-04-14 16:37:05 +0300 |
---|---|---|
committer | bogdanvlviv <bogdanvlviv@gmail.com> | 2016-04-17 23:12:16 +0300 |
commit | 26861302c936e336771ebf8e66754b5b0c9344de (patch) | |
tree | 45274a43d59e7d3860376cdb515e991870236351 /activerecord/lib/active_record | |
parent | 53ab1ee5652ead8d5e52e5a9c177a6f8a32c75b1 (diff) | |
download | rails-26861302c936e336771ebf8e66754b5b0c9344de.tar.gz rails-26861302c936e336771ebf8e66754b5b0c9344de.tar.bz2 rails-26861302c936e336771ebf8e66754b5b0c9344de.zip |
Added notice when a database is successfully created or dropped.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/tasks/database_tasks.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/tasks/database_tasks.rb b/activerecord/lib/active_record/tasks/database_tasks.rb index 8881986f1b..9aea5b360b 100644 --- a/activerecord/lib/active_record/tasks/database_tasks.rb +++ b/activerecord/lib/active_record/tasks/database_tasks.rb @@ -107,8 +107,9 @@ module ActiveRecord def create(*arguments) configuration = arguments.first class_for_adapter(configuration['adapter']).new(*arguments).create + $stdout.puts "Created database '#{configuration['database']}'" rescue DatabaseAlreadyExists - $stderr.puts "#{configuration['database']} already exists" + $stderr.puts "Database '#{configuration['database']}' already exists" rescue Exception => error $stderr.puts error $stderr.puts "Couldn't create database for #{configuration.inspect}" @@ -133,11 +134,12 @@ module ActiveRecord def drop(*arguments) configuration = arguments.first class_for_adapter(configuration['adapter']).new(*arguments).drop + $stdout.puts "Dropped database '#{configuration['database']}'" rescue ActiveRecord::NoDatabaseError $stderr.puts "Database '#{configuration['database']}' does not exist" rescue Exception => error $stderr.puts error - $stderr.puts "Couldn't drop #{configuration['database']}" + $stderr.puts "Couldn't drop database '#{configuration['database']}'" raise end |