summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAkshesh <aksheshdoshi@gmail.com>2016-07-22 18:22:44 +0530
committerTim Graham <timograham@gmail.com>2016-08-12 15:52:16 -0400
commit311a8e8d505049ff5644a94e16c00246c8a43a18 (patch)
treeb1414effbd64ec472f64e3484b63d20d4b554526 /docs
parent6b842c599865217529d835c0e20e881b98104295 (diff)
Fixed #20888 -- Added support for column order in class-based indexes.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/indexes.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/ref/models/indexes.txt b/docs/ref/models/indexes.txt
index b63e86517c..ac2839bbd4 100644
--- a/docs/ref/models/indexes.txt
+++ b/docs/ref/models/indexes.txt
@@ -34,6 +34,20 @@ options`_.
A list of the name of the fields on which the index is desired.
+By default, indexes are created with an ascending order for each column. To
+define an index with a descending order for a column, add a hyphen before the
+field's name.
+
+For example ``Index(fields=['headline', '-pub_date'])`` would create SQL with
+``(headline, pub_date DESC)``. Index ordering isn't supported on MySQL. In that
+case, a descending index is created as a normal index.
+
+.. admonition:: Support for column ordering on SQLite
+
+ Column ordering is supported on SQLite 3.3.0+ and only for some database
+ file formats. Refer to the `SQLite docs
+ <https://www.sqlite.org/lang_createindex.html>`_ for specifics.
+
``name``
--------