summaryrefslogtreecommitdiffstats
path: root/db/migrate
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20110228000100_copy_repositories_log_encoding.rb11
1 files changed, 2 insertions, 9 deletions
diff --git a/db/migrate/20110228000100_copy_repositories_log_encoding.rb b/db/migrate/20110228000100_copy_repositories_log_encoding.rb
index 4d975f80e..b422daba9 100644
--- a/db/migrate/20110228000100_copy_repositories_log_encoding.rb
+++ b/db/migrate/20110228000100_copy_repositories_log_encoding.rb
@@ -2,15 +2,8 @@ class CopyRepositoriesLogEncoding < ActiveRecord::Migration
def self.up
encoding = Setting.commit_logs_encoding.to_s.strip
encoding = encoding.blank? ? 'UTF-8' : encoding
- Repository.find(:all).each do |repo|
- scm = repo.scm_name
- case scm
- when 'Subversion', 'Mercurial', 'Git', 'Filesystem'
- repo.update_attribute(:log_encoding, nil)
- else
- repo.update_attribute(:log_encoding, encoding)
- end
- end
+ # encoding is NULL by default
+ Repository.update_all(["log_encoding = ?", encoding], "log_encoding IN ('Bazaar', 'Cvs', 'Darcs')")
end
def self.down