Merge pull request #1106 from mrichardson-shelter/backup-create-fix-mysql-syntax-error

Fixing MySQL syntax error
3-1-stable
Dmitriy Zaporozhets 2012-07-19 02:46:14 -07:00
commit 30eee67726
1 changed files with 1 additions and 1 deletions

View File

@ -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"