diff --git a/src/cms/templates/migrations/0015_log.py b/src/cms/templates/migrations/0015_log.py index 41d204b..1a78855 100644 --- a/src/cms/templates/migrations/0015_log.py +++ b/src/cms/templates/migrations/0015_log.py @@ -79,7 +79,7 @@ class Migration(migrations.Migration): "verbose_name": "log entry", "verbose_name_plural": "log entries", "ordering": ["-action_time"], - "index_together": {("content_type", "object_id")}, + 'indexes': [models.Index(fields=['content_type', 'object_id'], name='cms_templates_log_ctype_objid_idx')], }, managers=[ ("objects", django.contrib.admin.models.LogEntryManager()), diff --git a/src/cms/templates/models.py b/src/cms/templates/models.py index 14b3c3c..c6b421a 100644 --- a/src/cms/templates/models.py +++ b/src/cms/templates/models.py @@ -40,7 +40,7 @@ # and with index_together = ["content_type", "object_id"]) import inspect exec(inspect.getsource(LogEntry).replace('db_table = "django_admin_log"', - 'index_together = ["content_type", "object_id"]')\ + 'indexes = [models.Index(fields=["content_type", "object_id"])]')\ .replace('class LogEntry','class Log')\ .replace('models.TextField(_("object id"), blank=True, null=True)', 'models.PositiveIntegerField(_("object id"), blank=True, null=True)')) #nosec