#18081: Syncdb doesn't create database constraints for foreign keys referencing
a
proxy model.
-------------------------------------+-------------------------------------
Reporter: akaariai | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.4
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by charettes):
* cc: charette.s@… (removed)
* cc: charettes (added)
Comment:
This is not an issue anymore since calls to
[https://github.com/django/django/blob/244404227e8a1c5e241658ef0df789a28ed3bbc6/django/db/backends/base/schema.py#L872-L888
_create_fk_sql] are not conditional to ` not
field.target_field.model._meta.proxy`
([https://github.com/django/django/blob/244404227e8a1c5e241658ef0df789a28ed3bbc6/django/db/backends/base/schema.py#L251-L252
create_model],
[https://github.com/django/django/blob/244404227e8a1c5e241658ef0df789a28ed3bbc6/django/db/backends/base/schema.py#L411-L412
add_field],
[https://github.com/django/django/blob/244404227e8a1c5e241658ef0df789a28ed3bbc6/django/db/backends/base/schema.py#L714-L722
alter_field]).
I think a more appropriate regression test could live in `test_operations`
and issue an `AddField` of a foreign key pointing to `ProxyPony` and make
sure the constraint exists. Naturally the test should be
`skipUnlessDBFeature('supports_foreign_keys')`.
--
Ticket URL: <https://code.djangoproject.com/ticket/18081#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.6422e3a1b03371083715dfc7cb3f48af%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.