mirror of https://github.com/django/django.git
Fixed #22445 -- Added how to perform a reverse data migration to topic guide.
Thanks Karen Tracey for the report.
This commit is contained in:
parent
ab8d8e00c9
commit
1ce759b69f
|
@ -389,6 +389,11 @@ need to do is use the historical model and iterate over the rows::
|
||||||
Once that's done, we can just run ``python manage.py migrate`` as normal and
|
Once that's done, we can just run ``python manage.py migrate`` as normal and
|
||||||
the data migration will run in place alongside other migrations.
|
the data migration will run in place alongside other migrations.
|
||||||
|
|
||||||
|
You can pass a second callable to
|
||||||
|
:class:`~django.db.migrations.operations.RunPython` to run whatever logic you
|
||||||
|
want executed when migrating backwards. If this callable is omitted, migrating
|
||||||
|
backwards will raise an exception.
|
||||||
|
|
||||||
If you're interested in the more advanced migration operations, or want
|
If you're interested in the more advanced migration operations, or want
|
||||||
to be able to write your own, see the :doc:`migration operations reference
|
to be able to write your own, see the :doc:`migration operations reference
|
||||||
</ref/migration-operations>`.
|
</ref/migration-operations>`.
|
||||||
|
|
Loading…
Reference in New Issue