mysql introspection doesn't handle CHAR(n) fields
|Reported by:||Owned by:||Adrian Holovaty|
|Component:||Database layer (models, ORM)||Version:||0.96|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I have a legacy table that has columns like
CREATE TABLE `foo_info` ( `foo_tag` int(11) NOT NULL auto_increment, `record_type` char(8) default NULL, `name_prefix` char(10) default NULL, `first_name` char(20) default NULL, ...
note: CHAR, not VARCHAR.
"python manage.py inspectdb" turns these into TextFields since it doesn't know any better. They work much better as CharFields; the attached diff makes that happen.
Change History (6)
comment:1 Changed 10 years ago by
|Patch needs improvement:||unset|
|Triage Stage:||Unreviewed → Ready for checkin|