Commit 0456ceddb4d56e2090bfd03cf7e6c0bd7a2d8db9
1 parent
88033500
Exists in
master
and in
4 other branches
Fixing MySQL syntax error
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
lib/tasks/gitlab/backup.rake
@@ -159,7 +159,7 @@ namespace :gitlab do | @@ -159,7 +159,7 @@ namespace :gitlab do | ||
159 | print "- Dumping table #{tbl}... " | 159 | print "- Dumping table #{tbl}... " |
160 | count = 1 | 160 | count = 1 |
161 | File.open(File.join(backup_path_db, tbl + ".yml"), "w+") do |file| | 161 | File.open(File.join(backup_path_db, tbl + ".yml"), "w+") do |file| |
162 | - ActiveRecord::Base.connection.select_all("SELECT * FROM #{tbl}").each do |line| | 162 | + ActiveRecord::Base.connection.select_all("SELECT * FROM `#{tbl}`").each do |line| |
163 | line.delete_if{|k,v| v.blank?} | 163 | line.delete_if{|k,v| v.blank?} |
164 | output = {tbl + '_' + count.to_s => line} | 164 | output = {tbl + '_' + count.to_s => line} |
165 | file << output.to_yaml.gsub(/^---\n/,'') + "\n" | 165 | file << output.to_yaml.gsub(/^---\n/,'') + "\n" |