# Inconsistency in Indexes/Constraints docs

**URL:** https://forum.djangoproject.com/t/inconsistency-in-indexes-constraints-docs/36027
**Category:** ORM
**Created:** [October 28, 2024, 8:42pm UTC](https://forum.djangoproject.com/t/inconsistency-in-indexes-constraints-docs/36027 "2024-10-28T20:42:54Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![CNel-MM](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/cnel-mm/32/24847_2.png) [@CNel-MM](https://forum.djangoproject.com/u/CNel-MM)
#### Post date: [October 28, 2024, 8:42pm UTC](https://forum.djangoproject.com/t/inconsistency-in-indexes-constraints-docs/36027/1 "2024-10-28T20:42:54Z")

</div>

Django docs recommend we move away from using `db_index=True` & `index_together` in favor of the `indexes` Meta option. Likewise, the docs also recommend using the `constraints` Meta option instead of `unique_together` . But they do NOT make any such rec for the `unique=True` field option.

This sticks out a bit since it seem like for everything else the docs say “Hey put all your extra DB objects for your model in the Meta option”. Which would make sense to me, feels like it would be more readable to have them all in one place if nothing else. So why the inconsistency with `unique=True` ?

---

<div class="post-metadata">

### Author: ![CodenameTim](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/codenametim/32/31507_2.png) [@CodenameTim](https://forum.djangoproject.com/u/CodenameTim)
#### Post date: [October 31, 2024, 10:01am UTC](https://forum.djangoproject.com/t/inconsistency-in-indexes-constraints-docs/36027/2 "2024-10-31T10:01:11Z")

</div>

I suspect it’s just that an inconsistency. It’s probably worth creating a ticket.

However, as a django dev, I really don’t like how we are telling folks to not use fields because it may be deprecated in the future. I think those recommendations should be based on utility and flexibility of the API. The docs shouldn’t include include mentions of the general feeling of the current developers of Django.

---

<div class="post-metadata">

### Author: ![timgraham](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/timgraham/32/11972_2.png) [@timgraham](https://forum.djangoproject.com/u/timgraham)
#### Post date: [October 31, 2024, 2:09pm UTC](https://forum.djangoproject.com/t/inconsistency-in-indexes-constraints-docs/36027/3 "2024-10-31T14:09:24Z")

</div>

For additional context around a change, it’s often useful to do a `git blame` to find the commit that added the documentation and then lookup the pull request: [Doc'd that Meta.indexes is preferred to Field.db\_index. by adamchainz · Pull Request #12716 · django/django · GitHub](https://github.com/django/django/pull/12716).
