STATUS_ACTIVE = 1
STATUS_ARCHIVED = 9
+ # Maximum length for project identifiers
+ IDENTIFIER_MAX_LENGTH = 100
+
# Specific overidden Activities
has_many :time_entry_activities
has_many :members, :include => [:user, :roles], :conditions => "#{User.table_name}.type='User' AND #{User.table_name}.status=#{User::STATUS_ACTIVE}"
validates_presence_of :name, :identifier
validates_uniqueness_of :identifier
validates_associated :repository, :wiki
- validates_length_of :name, :maximum => 30
+ validates_length_of :name, :maximum => 255
validates_length_of :homepage, :maximum => 255
- validates_length_of :identifier, :in => 1..20
+ validates_length_of :identifier, :in => 1..IDENTIFIER_MAX_LENGTH
# donwcase letters, digits, dashes but not digits only
validates_format_of :identifier, :with => /^(?!\d+$)[a-z0-9\-]*$/, :if => Proc.new { |p| p.identifier_changed? }
# reserved words
<div class="box">
<!--[form:project]-->
-<p><%= f.text_field :name, :required => true, :maxlength => 30 %><br /><em><%= l(:text_caracters_maximum, 30) %></em></p>
+<p><%= f.text_field :name, :required => true, :size => 60 %></p>
<% unless @project.allowed_parents.compact.empty? %>
<p><%= label(:project, :parent_id, l(:field_parent)) %><%= parent_project_select_tag(@project) %></p>
<% end %>
<p><%= f.text_area :description, :rows => 5, :class => 'wiki-edit' %></p>
-<p><%= f.text_field :identifier, :required => true, :disabled => @project.identifier_frozen?, :maxlength => 20 %>
+<p><%= f.text_field :identifier, :required => true, :size => 60, :disabled => @project.identifier_frozen? %>
<% unless @project.identifier_frozen? %>
-<br /><em><%= l(:text_length_between, :min => 1, :max => 20) %> <%= l(:text_project_identifier_info) %></em>
+<br /><em><%= l(:text_length_between, :min => 1, :max => Project::IDENTIFIER_MAX_LENGTH) %> <%= l(:text_project_identifier_info) %></em>
<% end %></p>
<p><%= f.text_field :homepage, :size => 60 %></p>
<p><%= f.check_box :is_public %></p>
--- /dev/null
+class ChangeProjectsNameLimit < ActiveRecord::Migration
+ def self.up
+ change_column :projects, :name, :string, :limit => nil, :default => '', :null => false
+ end
+
+ def self.down
+ change_column :projects, :name, :string, :limit => 30, :default => '', :null => false
+ end
+end
--- /dev/null
+class ChangeProjectsIdentifierLimit < ActiveRecord::Migration
+ def self.up
+ change_column :projects, :identifier, :string, :limit => nil
+ end
+
+ def self.down
+ change_column :projects, :identifier, :string, :limit => 20
+ end
+end