#27236: Deprecate Model.Meta.index_together in favour of Model.Meta.indexes
-------------------------------------+-------------------------------------
Reporter: Akshesh Doshi | Owner: David
Type: | Wobrock
Cleanup/optimization | Status: closed
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: index_together | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):
* cc: Carlton Gibson (added)
Comment:
I think we need all three:
- more descriptive release notes for `AlterIndexTogether`,
- running checks only on unapplied migrations, and
- reducing `AlterIndexTogether` with `RenameIndex`.
Lots of folks don't recreate their databases so they won't have to do
anything. As for the rest, we can document possible solutions, e.g.
- squash migrations,
- update the historical `CreateModel()` operation with
`options={index_together=[...]}` with the current state of
`index_together` (as long as all fields existed when the model was
created),
- replace `AlterIndexTogether` with `AddIndex`/`RemoveIndex`.
--
Ticket URL: <https://code.djangoproject.com/ticket/27236#comment:33>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701820fa1b942-853ddb3b-b773-4be2-83ea-60b7f33a1dcc-000000%40eu-central-1.amazonses.com.