summaryrefslogtreecommitdiffstats
path: root/db/migrate
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-03 13:38:04 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-12-03 13:38:04 +0000
commit1fbcd1051ead84c6387af9d1faaf9cd1c0405653 (patch)
treeff90a1d84b7bef4128b484e96de743b755e96cdb /db/migrate
parent582574bace827b9cdff0e923142fa0e23b66a787 (diff)
downloadredmine-1fbcd1051ead84c6387af9d1faaf9cd1c0405653.tar.gz
redmine-1fbcd1051ead84c6387af9d1faaf9cd1c0405653.zip
Do not trigger repository validation in migration.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8043 e93f8b46-1217-0410-a6f0-8f06a7374b81
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