Defect #21993

Projects description cannot contain long text on MySQL

Added by okkez _ over 3 years ago. Updated about 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Database
Target version:-
Resolution: Affected version:

Description

Original migration [1] changes type of projects description from string to text. It means that projects description can contain text longer than 255 bytes.
In acutually, on MySQL, projects desctiption type is changed to text but it limit 255byte.

[1]: source:tags/3.2.0/db/migrate/087_change_projects_description_to_text.rb

0003-Raises-projects-description-limit-to-64KB.patch Magnifier (1.34 KB) okkez _, 2016-02-09 17:14


Related issues

Related to Redmine - Feature #19869: Consider increasing the size limit of description and not... Closed

History

#1 Updated by okkez _ over 3 years ago

This is related to #19869.

#2 Updated by Go MAEDA over 3 years ago

I can store 65535 bytes of text on my installation.

Rails console:

irb(main):001:0> Redmine::VERSION.to_s
=> "3.2.0.stable.15138" 
irb(main):002:0> ActiveRecord::Base.connection.adapter_name
=> "Mysql2" 
irb(main):003:0> Project.find_by_identifier('test').description.size
=> 65535

db/schema.rb:

  create_table "projects", force: :cascade do |t|
    t.string   "name",               limit: 255,   default: "",    null: false
    t.text     "description",        limit: 65535
    t.string   "homepage",           limit: 255,   default: "" 
    t.boolean  "is_public",                        default: true,  null: false
    t.integer  "parent_id",          limit: 4
    t.datetime "created_on" 
    t.datetime "updated_on" 
    t.string   "identifier",         limit: 255
    t.integer  "status",             limit: 4,     default: 1,     null: false
    t.integer  "lft",                limit: 4
    t.integer  "rgt",                limit: 4
    t.boolean  "inherit_members",                  default: false, null: false
    t.integer  "slack",              limit: 4,     default: 0,     null: false
    t.integer  "default_version_id", limit: 4
  end

#3 Updated by okkez _ over 3 years ago

My old db/schema.rb is:

  create_table "projects", force: :cascade do |t|
    t.string   "name",            limit: 255, default: "",    null: false
    t.text     "description",     limit: 255
    t.string   "homepage",        limit: 255, default: "" 
    t.boolean  "is_public",                   default: true,  null: false
    t.integer  "parent_id" 
    t.datetime "created_on" 
    t.datetime "updated_on" 
    t.string   "identifier",      limit: 255
    t.integer  "status",                      default: 1,     null: false
    t.integer  "lft" 
    t.integer  "rgt" 
    t.boolean  "inherit_members",             default: false, null: false
  end

This environment is version up from very old Redmine step by step.
So I don't know why my db/schema.rb has :limit => 255.

#4 Updated by Toshi MARUYAMA over 3 years ago

  • Description updated (diff)

#5 Updated by Toshi MARUYAMA over 3 years ago

  • Related to Feature #19869: Consider increasing the size limit of description and note columns for tickets added

#6 Updated by Toshi MARUYAMA about 3 years ago

  • Tracker changed from Patch to Defect
  • Category changed from Projects to Database
  • Status changed from New to Closed

http://stackoverflow.com/questions/3354330/difference-between-string-and-text-in-rails

As I described at #21123#note-6.
I think it is bug of rails or mysql adapter in old version.
We cannot do anything.
Try #20831#note-3.

Also available in: Atom PDF