mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #26760 -- Added --prune option to migrate command.
This commit is contained in:
committed by
Mariusz Felisiak
parent
eeff1787b0
commit
2d8232fa71
@@ -908,6 +908,14 @@ content types.
|
||||
Makes ``migrate`` exit with a non-zero status when unapplied migrations are
|
||||
detected.
|
||||
|
||||
.. django-admin-option:: --prune
|
||||
|
||||
.. versionadded:: 4.1
|
||||
|
||||
Deletes nonexistent migrations from the ``django_migrations`` table. This is
|
||||
useful when migration files replaced by a squashed migration have been removed.
|
||||
See :ref:`migration-squashing` for more details.
|
||||
|
||||
``runserver``
|
||||
-------------
|
||||
|
||||
|
||||
@@ -215,6 +215,9 @@ Management Commands
|
||||
input prompts to ``stderr``, writing only paths of generated migration files
|
||||
to ``stdout``.
|
||||
|
||||
* The new :option:`migrate --prune` option allows deleting nonexistent
|
||||
migrations from the ``django_migrations`` table.
|
||||
|
||||
Migrations
|
||||
~~~~~~~~~~
|
||||
|
||||
|
||||
@@ -715,6 +715,13 @@ You must then transition the squashed migration to a normal migration by:
|
||||
Once you've squashed a migration, you should not then re-squash that squashed
|
||||
migration until you have fully transitioned it to a normal migration.
|
||||
|
||||
.. admonition:: Pruning references to deleted migrations
|
||||
|
||||
.. versionadded:: 4.1
|
||||
|
||||
If it is likely that you may reuse the name of a deleted migration in the
|
||||
future, you should remove references to it from Django’s migrations table
|
||||
with the :option:`migrate --prune` option.
|
||||
|
||||
.. _migration-serializing:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user