mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #27666 -- Delayed rendering of recursivly related models in migration operations.
This commit is contained in:
committed by
Tim Graham
parent
7d2db2a7b8
commit
45ded053b1
@@ -593,6 +593,17 @@ must receive a dictionary of context rather than ``Context`` or
|
||||
dictionary instead -- doing so is backwards-compatible with older versions of
|
||||
Django.
|
||||
|
||||
Model state changes in migration operations
|
||||
-------------------------------------------
|
||||
|
||||
To improve the speed of applying migrations, rendering of related models is
|
||||
delayed until an operation that needs them (e.g. ``RunPython``). If you have a
|
||||
custom operation that works with model classes or model instances from the
|
||||
``from_state`` argument in ``database_forwards()`` or ``database_backwards()``,
|
||||
you must render model states using the ``clear_delayed_apps_cache()`` method as
|
||||
described in :ref:`writing your own migration operation
|
||||
<writing-your-own-migration-operation>`.
|
||||
|
||||
Miscellaneous
|
||||
-------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user