Opened 10 years ago

Closed 9 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@…> 10 years ago.
3588-filefield_maxlength_2.patch (4.5 KB) - added by Robert Myers <myer0052@…> 10 years ago.
3588-filefield_unlimited.patch (4.4 KB) - added by Chaiwat S. <cwt@…> 10 years ago.

Download all attachments as: .zip

Change History (10)

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

Triage Stage: UnreviewedAccepted

This restriction does seem rather limiting.

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

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

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

Has patch: set
Triage Stage: AcceptedReady 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 10 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 10 years ago by Simon G. <dev@…>

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

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

comment:5 Changed 10 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 10 years ago by Malcolm Tredinnick

Needs documentation: set
Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

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 9 years ago by James Bennett

Resolution: duplicate
Status: newclosed

Duplicate of #5361.

Note: See TracTickets for help on using tickets.
Back to Top