#22970: Migration dependencies not correctly calculated ---------------------------------+---------------------- Reporter: dekkers | Owner: nobody Type: Bug | Status: new Component: Migrations | Version: 1.7-rc-1 Severity: Release blocker | Keywords: Triage Stage: Unreviewed | Has patch: 0 Easy pickings: 0 | UI/UX: 0 ---------------------------------+---------------------- When working with the new migrations I hit a bug that dependencies between migrations aren't correctly calculated. Migrations that add a ForeignKey to a model in another app that was created in the second or later migrations of that other app have a depenency on the first migration instead of the later migration. Steps to reproduce:
* Start a new project and create two apps myapp1 and myapp2 * Add a model named Model1 to myapp1 * Run makemigrations, resulting in 0001_initial.py that creates Model1 * Add a model named Model2 to myapp1 * Run makemigrations, resulting in 0002_model2.py that creates Model2 * Add a model named Model3 with a !ForeignKey to 'myapp1.Model2' to myapp2 * Run makemigrations, resulting in 0001_initial.py that creates Model3 The 0001_initial.py of myapp2 will then have `('myapp1', '__first__')` as dependency while Model2 is created in the second migration. -- Ticket URL: <https://code.djangoproject.com/ticket/22970> 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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/050.b75110b1a8a777b54cc4d256f343f54a%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.