On Sunday 29 January 2017 11:41:39 Adam Johnson wrote:
> On 28 January 2017 at 21:45, Vitaliy Kucherivaiy <
ppr.v...@gmail.com>
> wrote:
> >
> > Do I understand this correctly - now there are 2 ways to make a single
> > field indexed in database:
> > - FieldClass(db_index=True)
> > - Model.Meta.indexes
> >
> > will it stay like this for future release or 1st approach will be
> > deprecated/removed later ?
> >
> Afaik there is no deprecation plan for *db_index*, and I doubt it would be
> since it would require lots of projects to update their models for no
> particular gain. Probably best to think of *db_index* as a shortcut for
> adding an index to *Meta.indexes*.
>
Exactly. This is similar to the situation with Field(unique=True) vs.
Meta.unique_together.