diff --git a/lib/tasks/gitlab/backup.rake b/lib/tasks/gitlab/backup.rake index 4fbde37ef3e0a1002868c7c9ee18026f9f7a7b8c..014483d4e8c2074a0975d79053e0e7d2dc22d098 100644 --- a/lib/tasks/gitlab/backup.rake +++ b/lib/tasks/gitlab/backup.rake @@ -159,7 +159,7 @@ namespace :gitlab do print "- Dumping table #{tbl}... " count = 1 File.open(File.join(backup_path_db, tbl + ".yml"), "w+") do |file| - ActiveRecord::Base.connection.select_all("SELECT * FROM #{tbl}").each do |line| + ActiveRecord::Base.connection.select_all("SELECT * FROM `#{tbl}`").each do |line| line.delete_if{|k,v| v.blank?} output = {tbl + '_' + count.to_s => line} file << output.to_yaml.gsub(/^---\n/,'') + "\n"