From 3076c88181010f16941dacce87ec7ebbbc57a8d6 Mon Sep 17 00:00:00 2001 From: David Wobrock Date: Fri, 28 Jan 2022 20:26:24 +0100 Subject: [PATCH] Add documentation about dropping a column in multiple steps --- docs/incompatibilities.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/incompatibilities.md b/docs/incompatibilities.md index 6272790..46e3c10 100644 --- a/docs/incompatibilities.md +++ b/docs/incompatibilities.md @@ -109,7 +109,9 @@ Deletion operations often lead to errors during deployment. 4. restore a backup of your data (if available and fresh enough) :white_check_mark: **Solutions**: -- Deprecate the column before dropping it using [django-deprecate-fields](https://github.com/3YOURMIND/django-deprecate-fields/) +- Deprecate the column before dropping it using [django-deprecate-fields](https://github.com/3YOURMIND/django-deprecate-fields/). +This process requires to first make sure that the field is unused (for which `django-deprecate-fields` is made for). +Once the column is unsed, drop it in a migration. This migration will require to be ignored through the [IgnoreMigration](docs/usage.md#ignoring-migrations) for instance. - Don't actually drop the column, but fake the drop migration until you are sure you won't roll back. Be careful :warning: fake dropping a non-nullable column without a database default will create errors once the code is not aware of the column anymore. @@ -127,7 +129,7 @@ Be careful :warning: fake dropping a non-nullable column without a database defa 4. restore a backup of your data (if available and fresh enough) :white_check_mark: **Solutions**: -- Do a multistep deleting. First, only update the code to make sure it is not querying the table anymore +- Do a multistep deletion. First, only update the code to make sure it is not querying the table anymore ### :arrow_forward: Altering a column