diff --git a/easyaudit/migrations/0018_rename_crudevent_object_id_content_type_index.py b/easyaudit/migrations/0018_rename_crudevent_object_id_content_type_index.py new file mode 100644 index 0000000..bfdc32b --- /dev/null +++ b/easyaudit/migrations/0018_rename_crudevent_object_id_content_type_index.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.3 on 2023-07-26 18:41 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('easyaudit', '0017_alter_requestevent_datetime'), + ] + + operations = [ + migrations.RenameIndex( + model_name='crudevent', + new_name='easyaudit_c_object__82020b_idx', + old_fields=('object_id', 'content_type'), + ), + ] diff --git a/easyaudit/models.py b/easyaudit/models.py index 65b3a3c..88fd5c9 100644 --- a/easyaudit/models.py +++ b/easyaudit/models.py @@ -57,7 +57,9 @@ class Meta: verbose_name = _('CRUD event') verbose_name_plural = _('CRUD events') ordering = ['-datetime'] - index_together = ['object_id', 'content_type', ] + indexes = [ + models.Index(fields=['object_id', 'content_type']), + ] class LoginEvent(models.Model):