summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2014-07-29 10:02:59 -0700
committerAndrew Godwin <andrew@aeracode.org>2014-07-29 10:03:59 -0700
commit3deddc2fdf1f47a9564b6d39ee53dc5bdd944dc2 (patch)
tree222eff91d814b9eaea9e6ef4fbfd7e795d630d39 /docs
parent0a4fbf4e13b194383f9eecc0af337a50fb6dfe98 (diff)
[1.7.x] Fixed #23090: Document and enforce not double-squashing migrations
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/migrations.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/topics/migrations.txt b/docs/topics/migrations.txt
index 80a86dee20..c9d6ee0e5d 100644
--- a/docs/topics/migrations.txt
+++ b/docs/topics/migrations.txt
@@ -487,6 +487,23 @@ 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.
+Once you've squashed your migration, you should then commit it alongside the
+migrations it replaces and distribute this change to all running instances
+of your application, making sure that they run ``migrate`` to store the change
+in their database.
+
+After this has been done, you must then transition the squashed migration to
+a normal initial migration, by:
+
+- Deleting all the migration files it replaces
+- Removing the ``replaces`` argument in the ``Migration`` class of the
+ squashed migration (this is how Django tells that it is a squashed migration)
+
+.. note::
+ 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.
+
+
.. _migration-serializing:
Serializing values