#22889 closed Cleanup/optimization (fixed)
Proper handling of to_field in deconstruct for AUTH_USER_MODEL foreign key
Reported by: | Tim Graham | Owned by: | nobody |
---|---|---|---|
Component: | Migrations | Version: | 1.7-beta-2 |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
to_field
shouldn't appear in the migration for a ForeignKey
to settings.AUTH_USER_MODEL
, otherwise the migration isn't usable if settings.AUTH_USER_MODEL
uses a primary key with a name different than 'id'.
It's not necessary to include the field name, the default behavior of models.ForeignKey is to look up the primary key field name from the target model.
from this pull request.
Change History (4)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
In 68b89f4d13b69771b232c1fcb0fb598000b6eb98: