20110228000100_copy_repositories_log_encoding.rb 373 Bytes
Newer Older
1
class CopyRepositoriesLogEncoding < ActiveRecord::Migration[4.2]
2 3 4
  def self.up
    encoding = Setting.commit_logs_encoding.to_s.strip
    encoding = encoding.blank? ? 'UTF-8' : encoding
5
    # encoding is NULL by default
6 7
    Repository.where("type IN ('Bazaar', 'Cvs', 'Darcs')").
                 update_all(["log_encoding = ?", encoding])
8 9 10 11 12
  end

  def self.down
  end
end