From 2a5aca38bbb37f6e7590ac6e68912bfbefb17dae Mon Sep 17 00:00:00 2001 From: "petr.prikryl" Date: Wed, 29 May 2024 11:22:32 +0200 Subject: Fixed #35487 -- Removed CASCADE from RemoveField() on PostgreSQL. Co-authored-by: Mariusz Felisiak Co-authored-by: Adam Johnson Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> --- docs/ref/migration-operations.txt | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'docs/ref') diff --git a/docs/ref/migration-operations.txt b/docs/ref/migration-operations.txt index 8379221df5..26c0c14218 100644 --- a/docs/ref/migration-operations.txt +++ b/docs/ref/migration-operations.txt @@ -195,15 +195,12 @@ if the field is nullable or if it has a default value that can be used to populate the recreated column. If the field is not nullable and does not have a default value, the operation is irreversible. -.. admonition:: PostgreSQL - - ``RemoveField`` will also delete any additional database objects that are - related to the removed field (like views, for example). This is because the - resulting ``DROP COLUMN`` statement will include the ``CASCADE`` clause to - ensure `dependent objects outside the table are also dropped`_. - -.. _dependent objects outside the table are also dropped: https://www.postgresql.org/docs/current/sql-altertable.html#SQL-ALTERTABLE-PARMS-CASCADE +.. versionchanged:: 6.0 + :class:`~django.db.backends.base.schema.BaseDatabaseSchemaEditor` and + PostgreSQL backends no longer use ``CASCADE`` to delete dependent related + database objects, such as views. Any dependent objects that are not managed + by Django may need to be removed manually before running ``RemoveField``. ``AlterField`` -------------- -- cgit v1.3