Opened 11 years ago
Closed 11 years ago
#21097 closed Bug (fixed)
IntrospectionTests incorrectly validates an AutoField as an IntegerField
Reported by: | Michael Manfre | Owned by: | Michael Manfre |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Normal | Keywords: | inspectdb |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
The Reporter model doesn't have an explicitly defined primary_key and should have an implicit AutoField(primary_key=True)
added to the model.
https://docs.djangoproject.com/en/dev/topics/db/models/#automatic-primary-key-fields
None of the core backends support introspecting an AutoField, but some 3rd party backends do (django-mssql). I propose adding a new DatabaseFeature can_introspect_autofield
that allows backends to decide whether they can distinguish between an AutoField and an IntegerField.
Change History (5)
comment:1 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 11 years ago
Owner: | changed from | to
---|
comment:3 by , 11 years ago
Easy pickings: | set |
---|---|
Has patch: | set |
comment:4 by , 11 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
Seems to be ready. I can likely commit this tomorrow.
comment:5 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
https://github.com/django/django/pull/1621