diff --git a/easyaudit/migrations/0018_crudevent_easyaudit_c_datetim_a13040_idx.py b/easyaudit/migrations/0018_crudevent_easyaudit_c_datetim_a13040_idx.py new file mode 100644 index 0000000..ad5b1a5 --- /dev/null +++ b/easyaudit/migrations/0018_crudevent_easyaudit_c_datetim_a13040_idx.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1.7 on 2023-03-27 11:08 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('easyaudit', '0017_alter_requestevent_datetime'), + ] + + operations = [ + migrations.AddIndex( + model_name='crudevent', + index=models.Index(fields=['-datetime'], name='easyaudit_c_datetim_a13040_idx'), + ), + ] diff --git a/easyaudit/models.py b/easyaudit/models.py index 65b3a3c..1d7ce3d 100644 --- a/easyaudit/models.py +++ b/easyaudit/models.py @@ -58,7 +58,9 @@ class Meta: verbose_name_plural = _('CRUD events') ordering = ['-datetime'] index_together = ['object_id', 'content_type', ] - + indexes = [ + models.Index(fields=['-datetime',]), + ] class LoginEvent(models.Model): LOGIN = 0