#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
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
> We should probably run check_deprecation_details() only for not applied
migrations. What do you think?
I think this will go a long way in avoiding to spam users every single
time they run a management command that triggers system checks but it's
not uncommon for developers to drop their local database and start from
scratch.
Ultimately they'll have to squash their migrations before 5.1 if they want
to avoid having their migration breaking so I wonder if we are doing them
a favour by silencing the check which than can already silence using
`SILENCED_SYSTEM_CHECKS`.
I think the system check hint should point at the proper procedure of
using `indexes` and running `makemigrations` instead?
Ultimately the only way for all the warnings and check errors to go away
before 5.1 where `AlterIndexTogether` will likely be marked as `elidable =
True` since it will be a noop is for users to manually edit their
migrations to replace their usage of `AlterIndexTogether` by `AddIndex`
and friends. I'm not sure the current documentation does a good job at
explaining how this must be done as it's a relatively complex operation.
Maybe there something that could be done through
`RenameIndex.reduce(operation: AlterIndexTogether)` to ease the pain when
`old_fields` is present here and have migration squashing handle most of
the cases? Otherwise I foresee a lot of reports coming our way on the 5.1
rollout saying that `RenameIndex` is failing to run due to a missing
index.
--
Ticket URL: <https://code.djangoproject.com/ticket/27236#comment:31>
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/0107018202692119-4ddef967-ad45-47e5-af3a-a0e32408f939-000000%40eu-central-1.amazonses.com.