Mercurial > hg > soundsoftware-site
diff .svn/pristine/ac/ac50a6b39635018231c646605bc398d2a48c5f14.svn-base @ 1517:dffacf8a6908 redmine-2.5
Update to Redmine SVN revision 13367 on 2.5-stable branch
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 09:29:00 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.svn/pristine/ac/ac50a6b39635018231c646605bc398d2a48c5f14.svn-base Tue Sep 09 09:29:00 2014 +0100 @@ -0,0 +1,15 @@ +class RemoveCustomFieldsMinMaxLengthDefaultValues < ActiveRecord::Migration + def up + change_column :custom_fields, :min_length, :int, :default => nil, :null => true + change_column :custom_fields, :max_length, :int, :default => nil, :null => true + CustomField.where(:min_length => 0).update_all(:min_length => nil) + CustomField.where(:max_length => 0).update_all(:max_length => nil) + end + + def self.down + CustomField.where(:min_length => nil).update_all(:min_length => 0) + CustomField.where(:max_length => nil).update_all(:max_length => 0) + change_column :custom_fields, :min_length, :int, :default => 0, :null => false + change_column :custom_fields, :max_length, :int, :default => 0, :null => false + end +end