From 5a82acbda8c9a7b83030101024def2404318dca9 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Tue, 14 Apr 2020 13:53:42 +0100 Subject: [PATCH] [4.2.x] Doc'd that Meta.indexes is preferred to Field.db_index. Backport of f9fe062de5fc0896d6bbbf3f260b5c44473b3c77 from main --- docs/ref/models/fields.txt | 7 +++++++ 1 file changed, 7 insertions(+) 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 ` 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`` -----------------