mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #20888 -- Added support for column order in class-based indexes.
This commit is contained in:
parent
6b842c5998
commit
311a8e8d50
4 changed files with 60 additions and 6 deletions
|
@ -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``
|
||||
--------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue