mirror of
https://github.com/redmine/redmine.git
synced 2024-08-18 02:12:06 +02:00
![Jean-Philippe Lang](/assets/img/avatar_default.png)
git-svn-id: http://svn.redmine.org/redmine/trunk@12405 e93f8b46-1217-0410-a6f0-8f06a7374b81
16 lines
736 B
Ruby
16 lines
736 B
Ruby
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
|