Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[1.7.x] Update squashmigration docs to also mention circ dep errs (re…

…fs #23337)
  • Loading branch information...
commit fbe45076234b1509a574a78a0f2b2dda602836db 1 parent f8aa2aa
@andrewgodwin andrewgodwin authored
Showing with 10 additions and 5 deletions.
  1. +10 −5 docs/topics/migrations.txt
View
15 docs/topics/migrations.txt 100644 → 100755
@@ -483,11 +483,16 @@ work::
you can delete them.
Note that model interdependencies in Django can get very complex, and squashing
-may occasionally result in an optimized migration that doesn't work or is
-impossible to run. When this occurs, you can re-try with ``--no-optimize``, but
-please `file a bug report <https://code.djangoproject.com/newticket>`_ either
-way detailing the models and their relationships so we can improve the
-optimizer to handle your case.
+may result in migrations that do not run; either mis-optimized (in which case
+you can try again with ``--no-optimize``, though you should also report an issue),
+or with a ``CircularDependencyError``, in which case you can manually resolve it.
+
+To manually resolve a ``CircularDependencyError``, break out one of
+the ForeignKeys in the circular dependency loop into a separate
+migration, and move the dependency on the other app with it. If you're unsure,
+see how makemigrations deals with the problem when asked to create brand
+new migrations from your models. In a future release of Django, squashmigrations
+will be updated to attempt to resolve these errors itself.
Once you've squashed your migration, you should then commit it alongside the
migrations it replaces and distribute this change to all running instances
Please sign in to comment.
Something went wrong with that request. Please try again.