ForeignKey cascading deletes fail with Integrity Error when to_field attribute set to field other than primary key
|Reported by:||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.3-beta|
|Severity:||Keywords:||to_field, cascade, on_delete|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
ForeignKey cascading delete fails with Integrity Error when to_field argument set to field other than primary key. Setting the on_delete argument doesn't change this behavior either.
models.ForeignKey(Design, related_name='reports', to_field="uuid", on_delete=models.CASCADE)