fix: keep modified indexed if that's what schema asks for (#25668)

This commit is contained in:
Ankush Menat 2024-03-27 14:19:49 +05:30 committed by GitHub
parent 432c8cf48c
commit c051c7aba8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -34,6 +34,9 @@ class MariaDBTable(DBTable):
else:
# parent types
additional_definitions.append("index creation(creation)")
if self.meta.sort_field == "modified":
# Support old doctype default by indexing it, also 2nd popular choice.
additional_definitions.append("index modified(modified)")
# creating sequence(s)
if not self.meta.issingle and self.meta.autoname == "autoincrement":