Opened 15 years ago
Closed 15 years ago
#13318 closed (worksforme)
Django messed up the table names.
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.2-beta |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I am working on a project which contains multiple tables in model. I named on table Users with the meta setup to be 'Users'. However, the table was created in mysql is "Users" rather than "users". There are also some tables' names contains upper case characters. Event mysql is case-insensitive, it still causes foreign key creation failure.
When I change all meta table name to lowercase, everything works.
So I guess there must be something wrong with the parser of the model in the current django release.
Under my testing, if you have the following models:
This has capitals where capitals are needed, and quoting where quoting is needed to preserve those capitals. As far as I can make out this is completely correct.