Skip to content

Deprecate Model.Meta.index_together in favour of Model.Meta.indexes #343

@awais786

Description

@awais786

The index_together option in Django model Meta classes has been deprecated and is now removed:

https://docs.djangoproject.com/en/5.1/releases/4.2/#features-deprecated-in-4-2

If this still exists in our codebase, we’ll encounter the following error during tests or migrations:

TypeError: ‘class Meta’ got invalid attribute(s): index_together

This isn’t just a minor cleanup — it affects database indexes and requires new migration.

The django-upgrade tool does not automatically detect or handle this issue, so it will require manual intervention.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions