#27319: Circular ForeignKeys between two unmanaged models produce incomplete
migrations
-------------------------------+--------------------
Reporter: Jamie Bliss | Owner: nobody
Type: Uncategorized | Status: new
Component: Migrations | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
From what I understand, `makemigrations` produces migrations for unmanaged
models, and the state of those migrations are tracked, but no SQL is
actually run.
The way that `makemigrations` handles circular `ForeignKey` references
between two models is to produce two migrations. (This may only happen if
the two models are in different applications.)
However, when both the models involved are unmanaged (`managed = False`),
the second migration is not produced, leaving the migrations overall
inconsistent with the models (and therefore, useless).
The workaround appears to be temporarily removing the managed flag,
running the migrations, restoring the managed flag on the models and
manually inserting it into the migrations.
--
Ticket URL: <https://code.djangoproject.com/ticket/27319>
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/057.88a8439167102a7549ec7b1ed9f2db90%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.