Ticket #390 (closed defect: wontfix)
South can't handle circular app dependencies under MySQL with InnoDB
|Reported by:||vasili@…||Owned by:||andrew|
In the dependency documentation, one of the two rules mentioned is: "No circular dependencies (two or more migrations depending on each other)".
However, Django itself allows circular dependencies between apps:
#appone/models.py: from django.db import models class ThingOne(models.Model): name = models.CharField(max_length=20) related_to = models.ForeignKey("apptwo.ThingTwo")
#apptwo/models.py: from django.db import models from appone.models import ThingOne class ThingTwo(models.Model): related_to = models.ForeignKey(ThingOne)
./manage.py syncdb does the right thing in this situation and adds foreign key constraints after creating both tables.
But if both apps are migrated with south, the migration fails when using innodb, as south tries to add the foreign key constraint for appone before creating apptwo's table.
Although the constraint of not allowing circular dependencies between migrations might make sense in other situations, here it makes south unable to deal with a legal Django model. Executing 'alter table' statements to add constraints at the end of the migration should solve this.
- Status changed from new to closed
- Milestone set to 0.7
- Resolution set to wontfix
- Reporter changed from vasili at the domain techcollective.com to vasili@…