Opened 18 years ago
Closed 17 years ago
#3588 closed (duplicate)
increase length of FileField, FilePathField, ImageField from varchar(100)
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Keywords: | FileField FilePathField ImageField | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | yes |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
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)
Change History (10)
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Accepted |
---|
by , 18 years ago
Attachment: | 3588-filefield_maxlength.patch added |
---|
by , 18 years ago
Attachment: | 3588-filefield_maxlength_2.patch added |
---|
comment:2 by , 18 years ago
Has patch: | set |
---|---|
Triage Stage: | Accepted → 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 by , 18 years ago
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 by , 18 years ago
Summary: | FileField, FilePathField, ImageField shouldn't be varchar(100) → increase length of FileField, FilePathField, ImageField from varchar(100) |
---|
by , 18 years ago
Attachment: | 3588-filefield_unlimited.patch added |
---|
comment:5 by , 18 years ago
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 by , 18 years ago
Needs documentation: | set |
---|---|
Patch needs improvement: | set |
Triage Stage: | Ready for checkin → 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.
This restriction does seem rather limiting.