mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
Replace index_together with indexes
index_together is deprecated in Django 4.2.
This commit is contained in:
parent
36a782945b
commit
89c0535cab
2 changed files with 18 additions and 1 deletions
15
auditlog/migrations/0019_rename_logentry_idx.py
Normal file
15
auditlog/migrations/0019_rename_logentry_idx.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("auditlog", "0018_logentry_remote_port"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameIndex(
|
||||
model_name="logentry",
|
||||
new_name="auditlog_timestamp_id_idx",
|
||||
old_fields=("timestamp", "id"),
|
||||
),
|
||||
]
|
||||
|
|
@ -377,7 +377,9 @@ class LogEntry(models.Model):
|
|||
ordering = ["-timestamp"]
|
||||
verbose_name = _("log entry")
|
||||
verbose_name_plural = _("log entries")
|
||||
index_together = ("timestamp", "id")
|
||||
indexes = [
|
||||
models.Index(fields=["timestamp", "id"], name="auditlog_timestamp_id_idx"),
|
||||
]
|
||||
|
||||
def __str__(self):
|
||||
if self.action == self.Action.CREATE:
|
||||
|
|
|
|||
Loading…
Reference in a new issue