mysql introspection doesn't handle CHAR(n) fields
|Reported by:||Bill Fenner <fenner@…>||Owned by:||adrian|
|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)
Changed 9 years ago by Bill Fenner <fenner@…>
comment:1 Changed 9 years ago by Simon G. <dev@…>
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Ready for checkin