Add documentation about dropping a column in multiple steps
This commit is contained in:
1 parent
7674a51bc9
commit
3076c88181
1 file changed
+4
-2
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user