1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #35487 -- Removed CASCADE from RemoveField() on PostgreSQL.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Adam Johnson <me@adamj.eu>
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
This commit is contained in:
petr.prikryl
2024-05-29 11:22:32 +02:00
committed by Mariusz Felisiak
parent de1117ea8e
commit 2a5aca38bb
7 changed files with 15 additions and 15 deletions

View File

@@ -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``
--------------

View File

@@ -254,6 +254,9 @@ backends.
* ``BaseDatabaseCreation.create_test_db(serialize)`` is deprecated. Use
``serialize_db_to_string()`` instead.
* :class:`~django.db.backends.base.schema.BaseDatabaseSchemaEditor` and
PostgreSQL backends no longer use ``CASCADE`` when dropping a column.
Dropped support for MariaDB 10.5
--------------------------------