diff options
author | Jeremy Daer <jeremydaer@gmail.com> | 2016-04-17 15:21:43 -0700 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2016-04-17 15:21:43 -0700 |
commit | 5154701e204b1c71c2b44d7b9f931dbe468f8030 (patch) | |
tree | 4468a0892c34bcd4784c1534d765d8c548d064f1 /activerecord/lib | |
parent | 2c8e0bba4b5122aec03299c1f3726be8343ca3c0 (diff) | |
parent | 26861302c936e336771ebf8e66754b5b0c9344de (diff) | |
download | rails-5154701e204b1c71c2b44d7b9f931dbe468f8030.tar.gz rails-5154701e204b1c71c2b44d7b9f931dbe468f8030.tar.bz2 rails-5154701e204b1c71c2b44d7b9f931dbe468f8030.zip |
Merge pull request #24551 from bogdanvlviv/notice_for_tasks
Added notice when a database is successfully created or dropped.
Diffstat (limited to 'activerecord/lib')
-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 |