Closed cpina closed 1 year ago
When @jen-thomas and I wrote the models we over-used unique_together to avoid "duplicates".
unique_together
In many of the cases we created "unique_together" to have a constraint and not needed an index.
We should have used https://docs.djangoproject.com/en/4.0/ref/models/constraints/#uniqueconstraint to make it more clear and avoid possible problems with too long indexes (which happened when we migrated to a certain MariaDB version).
This is just a heads up for the new maintainer @macloux , it doesn't actually cause any problem now or in short term (that I know of).
When @jen-thomas and I wrote the models we over-used
unique_together
to avoid "duplicates".In many of the cases we created "unique_together" to have a constraint and not needed an index.
We should have used https://docs.djangoproject.com/en/4.0/ref/models/constraints/#uniqueconstraint to make it more clear and avoid possible problems with too long indexes (which happened when we migrated to a certain MariaDB version).
This is just a heads up for the new maintainer @macloux , it doesn't actually cause any problem now or in short term (that I know of).