summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2025-09-19 16:27:51 +0200
committerNatalia <124304+nessita@users.noreply.github.com>2025-10-13 14:54:20 -0300
commit0fa339ce71bae6f9cebe341876f6aa41840ca2ff (patch)
tree9c45f2ab02c3b8c685fb9cad8bd013793df77228 /docs
parent86e7406cfb839a6c5384e9f72a55ef78eccc9a3c (diff)
[6.0.x] Fixed #36611, Refs #36580 -- Added system check for multicolumn ForeignObject in Meta.indexes/constraints/unique_together.
ForeignObjects with multiple `from_fields` are not supported in these options. Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com> Co-authored-by: Natalia <124304+nessita@users.noreply.github.com> Backport of 5b51e6f759f2ba993219347435149173c756c478 from main.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/checks.txt3
-rw-r--r--docs/releases/6.0.txt4
2 files changed, 7 insertions, 0 deletions
diff --git a/docs/ref/checks.txt b/docs/ref/checks.txt
index ab92220ac9..7735eed478 100644
--- a/docs/ref/checks.txt
+++ b/docs/ref/checks.txt
@@ -443,6 +443,9 @@ Models
* **models.E048**: ``constraints/indexes/unique_together`` refers to a
``CompositePrimaryKey`` ``<field name>``, but ``CompositePrimaryKey``\s are
not supported for that option.
+* **models.E049**: ``constraints/indexes/unique_together`` refers to a
+ ``ForeignObject`` ``<field name>`` with multiple ``from_fields``, which is
+ not supported for that option.
Management Commands
-------------------
diff --git a/docs/releases/6.0.txt b/docs/releases/6.0.txt
index 56e4bf2315..fd30c66121 100644
--- a/docs/releases/6.0.txt
+++ b/docs/releases/6.0.txt
@@ -295,6 +295,10 @@ Models
don't support it (MySQL and MariaDB), the fields are marked as deferred to
trigger a refresh on subsequent accesses.
+* Using a :ref:`ForeignObject <cpk-and-relations>` with multiple
+ ``from_fields`` in Model indexes, constraints, or :attr:`unique_together
+ <django.db.models.Options.unique_together>` now emits a system check error.
+
Pagination
~~~~~~~~~~