summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAdam Johnson <me@adamj.eu>2020-04-14 13:53:42 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2023-02-24 09:08:59 +0100
commitf9fe062de5fc0896d6bbbf3f260b5c44473b3c77 (patch)
treecff96c32c0086aa0d85f13c0bce0bb842a66e025 /docs
parent2c428b37ae14b1514cfe1466fd91f01d56799bf4 (diff)
Doc'd that Meta.indexes is preferred to Field.db_index.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/fields.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index 81f3013892..c449a1381c 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -351,6 +351,13 @@ looking at your Django code. For example::
If ``True``, a database index will be created for this field.
+.. admonition:: Use the :attr:`~Options.indexes` option instead.
+
+ Where possible, use the :attr:`Meta.indexes <Options.indexes>` option
+ instead. In nearly all cases, :attr:`~Options.indexes` provides more
+ functionality than ``db_index``. ``db_index`` may be deprecated in the
+ future.
+
``db_tablespace``
-----------------