Code

Opened 7 years ago

Closed 7 years ago

#3588 closed (duplicate)

increase length of FileField, FilePathField, ImageField from varchar(100)

Reported by: midfield <midfield@…> Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords: FileField FilePathField ImageField
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: yes
Easy pickings: UI/UX:

Description

If you run into long file names and / or paths, this is an onerous restriction. Please make FileField, FilePathField, ImageField use varchar(maxlength).

Attachments (3)

3588-filefield_maxlength.patch (4.5 KB) - added by Robert Myers <myer0052@…> 7 years ago.
3588-filefield_maxlength_2.patch (4.5 KB) - added by Robert Myers <myer0052@…> 7 years ago.
3588-filefield_unlimited.patch (4.4 KB) - added by Chaiwat S. <cwt@…> 7 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 7 years ago by Robert Myers <myer0052@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

This restriction does seem rather limiting.

Changed 7 years ago by Robert Myers <myer0052@…>

Changed 7 years ago by Robert Myers <myer0052@…>

comment:2 Changed 7 years ago by Robert Myers <myer0052@…>

  • Has patch set
  • Triage Stage changed from Accepted to Ready for checkin

I have changed the creation files to make the FileField, FilePathField, and ImageField to be varchar(255). Which is the max length of filenames for Fat/Ext2/Ext3 and also the limit for varchar in Mysql < 5.0.3

Also I noticed the oracle Slugfield was hardcoded to 50 I changed it to varchar2(%(maxlength)s) which is the same as the other backends.

comment:3 Changed 7 years ago by midfield@…

while 255 is the maximum length for a filename, FileField et al has to potetially store entire paths to files, which can easily get longer than 255. so this is a minor vote again for varchar(maxlength) for FileFields et al.

comment:4 Changed 7 years ago by Simon G. <dev@…>

  • Summary changed from FileField, FilePathField, ImageField shouldn't be varchar(100) to increase length of FileField, FilePathField, ImageField from varchar(100)

Changed 7 years ago by Chaiwat S. <cwt@…>

comment:5 Changed 7 years ago by Chaiwat S. <cwt@…>

I think it should be better if we change to 'text' to support path + filename.
So I create a patch base on 3588-filefield_maxlength_2.patch, but change to 'text' or something like 'TextField'.

comment:6 Changed 7 years ago by mtredinnick

  • Needs documentation set
  • Patch needs improvement set
  • Triage Stage changed from Ready for checkin to Accepted

Part of fixing this bug includes writing up instructions for how to port existing models to the changed versions. These are the instructions that will go on the [BackwardsIncompatibleChanges] wiki page.

So, in addition to updating the patch to include the postgresql_psycopg2 backend, can people please start working out how to move models across to this new version for each of our supported databases (MySQL, PostgreSQL and SQLite). For bonus points, work out the Oracle version as well, but we can probably ask the Oracle Boulder Sprinters group for help with that.

comment:7 Changed 7 years ago by ubernostrum

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #5361.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.