From bdf3863bddd4e1bb91cfc3dec26e88420246426a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pave=C5=82=20Ty=C5=9Blacki?= Date: Thu, 27 Dec 2018 22:43:30 +0300 Subject: [PATCH] Fixed #30063 -- Doc'd that Meta.unique_together may be deprecated in favor of Meta.constraints. --- docs/ref/models/options.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/ref/models/options.txt b/docs/ref/models/options.txt index cbc199ba3d..e06a099a61 100644 --- a/docs/ref/models/options.txt +++ b/docs/ref/models/options.txt @@ -404,6 +404,12 @@ Django quotes column and table names behind the scenes. .. attribute:: Options.unique_together + .. admonition:: Use :class:`.UniqueConstraint` with the :attr:`~Options.constraints` option instead. + + :class:`.UniqueConstraint` provides more functionality than + ``unique_together``. ``unique_together`` may be deprecated in the + future. + Sets of field names that, taken together, must be unique:: unique_together = (("driver", "restaurant"),)