aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2013-03-04 13:02:38 +0100
committerYves Senn <yves.senn@gmail.com>2013-03-06 15:12:48 +0100
commit0a5fdcd5ae2f7928ce9ce492c9815ad71f858a9f (patch)
tree266606a6ffa2b92a57529c724f6875a02c63e1e3 /activerecord/lib/active_record
parent854b74242c03b34df6b0107b23361b5c130b9550 (diff)
downloadrails-0a5fdcd5ae2f7928ce9ce492c9815ad71f858a9f.tar.gz
rails-0a5fdcd5ae2f7928ce9ce492c9815ad71f858a9f.tar.bz2
rails-0a5fdcd5ae2f7928ce9ce492c9815ad71f858a9f.zip
rake db:structure:dump warns when `mysqldump` is not in PATH.
Closes #9518. The rake task used to fail silently and left an empty `structure.sql`. It's confusing for users to get to the root of the problem. The warning message tells them where to look.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/tasks/mysql_database_tasks.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/tasks/mysql_database_tasks.rb b/activerecord/lib/active_record/tasks/mysql_database_tasks.rb
index 17378969a5..10696258c9 100644
--- a/activerecord/lib/active_record/tasks/mysql_database_tasks.rb
+++ b/activerecord/lib/active_record/tasks/mysql_database_tasks.rb
@@ -57,7 +57,10 @@ module ActiveRecord
args.concat(["--result-file", "#{filename}"])
args.concat(["--no-data"])
args.concat(["#{configuration['database']}"])
- Kernel.system(*args)
+ unless Kernel.system(*args)
+ $stderr.puts "Could not dump the database structure. "\
+ "Make sure `mysqldump` is in your PATH and check the command output for warnings."
+ end
end
def structure_load(filename)