Skip to content

Commit

Permalink
Doc'd that RemoveField also drops related database objects in Postgre…
Browse files Browse the repository at this point in the history
…SQL.
  • Loading branch information
shangxiao authored Apr 16, 2024
1 parent d048f0d commit f0d50a9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/ref/migration-operations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,16 @@ 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


``AlterField``
--------------

Expand Down

0 comments on commit f0d50a9

Please sign in to comment.