]> source.dussan.org Git - redmine.git/commitdiff
Increase maximum size for role name (#27625).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 20 Jun 2019 13:59:16 +0000 (13:59 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 20 Jun 2019 13:59:16 +0000 (13:59 +0000)
Patch by Aleksandar Pavic.

git-svn-id: http://svn.redmine.org/redmine/trunk@18296 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/role.rb
db/migrate/20190620135549_change_roles_name_limit.rb [new file with mode: 0644]

index 38014102e81fdb0e54257211baae2c85a9984576..0a0f1dd6d8b7808db777dbc018e26c9047de6d2e 100644 (file)
@@ -77,7 +77,7 @@ class Role < ActiveRecord::Base
 
   validates_presence_of :name
   validates_uniqueness_of :name
-  validates_length_of :name, :maximum => 30
+  validates_length_of :name, :maximum => 255
   validates_inclusion_of :issues_visibility,
     :in => ISSUES_VISIBILITY_OPTIONS.collect(&:first),
     :if => lambda {|role| role.respond_to?(:issues_visibility) && role.issues_visibility_changed?}
diff --git a/db/migrate/20190620135549_change_roles_name_limit.rb b/db/migrate/20190620135549_change_roles_name_limit.rb
new file mode 100644 (file)
index 0000000..29f5b03
--- /dev/null
@@ -0,0 +1,9 @@
+class ChangeRolesNameLimit < ActiveRecord::Migration[5.2]
+  def self.up
+    change_column :roles, :name, :string, :limit => 255, :default => ''
+  end
+  
+  def self.down
+    change_column :roles, :name, :string, :limit => 30, :default => ''
+  end
+end