summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2021-12-24 18:37:22 -0500
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-01-21 17:10:31 +0100
commit2d8232fa716f5fe46eec9f35a0e90c2d0f126279 (patch)
tree1b600a3c218b92db5077ede96ea86ca574b8a428 /docs
parenteeff1787b0aa23016e4844c0f537d5093a95a356 (diff)
Fixed #26760 -- Added --prune option to migrate command.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/django-admin.txt8
-rw-r--r--docs/releases/4.1.txt3
-rw-r--r--docs/topics/migrations.txt7
3 files changed, 18 insertions, 0 deletions
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt
index 78770fbf72..a60c538331 100644
--- a/docs/ref/django-admin.txt
+++ b/docs/ref/django-admin.txt
@@ -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``
-------------
diff --git a/docs/releases/4.1.txt b/docs/releases/4.1.txt
index c2a13a86b4..8a531039ef 100644
--- a/docs/releases/4.1.txt
+++ b/docs/releases/4.1.txt
@@ -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
~~~~~~~~~~
diff --git a/docs/topics/migrations.txt b/docs/topics/migrations.txt
index d7daa69281..73dec300e0 100644
--- a/docs/topics/migrations.txt
+++ b/docs/topics/migrations.txt
@@ -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: