Opened 16 years ago
Closed 13 years ago
#8317 closed Bug (fixed)
inspectdb does not set primary_key=True or unique=True on foreign keys
Reported by: | Bob Thomas | Owned by: | David Gouldin |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Normal | Keywords: | inspectdb |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The inspectdb command will not set primary_key=True or unique=True on ForeignKey fields when the column is also a primary key.
Attachments (2)
Change History (10)
by , 16 years ago
Attachment: | primary_fk.diff added |
---|
comment:1 by , 16 years ago
milestone: | → post-1.0 |
---|---|
Needs tests: | set |
Triage Stage: | Unreviewed → Accepted |
Jeremy Dunck was looking into writing some tests for inspectdb as part of #7285 and #6935. This change should add to those tests when it's landed. It seems like a reasonable change, but it can wait until we have time to check it's not going to break anything else (for which tests will be very handy).
comment:3 by , 15 years ago
comment:4 by , 14 years ago
Component: | django-admin.py inspectdb → Core (Management commands) |
---|
comment:5 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Bug |
comment:6 by , 13 years ago
Easy pickings: | unset |
---|---|
Keywords: | inspectdb added |
UI/UX: | unset |
by , 13 years ago
Attachment: | 8317_with_tests.diff added |
---|
comment:7 by , 13 years ago
Owner: | changed from | to
---|
Note:
See TracTickets
for help on using tickets.
Move the code that sets primary_key=True above the check for foreign keys