Many queries, including the default ordering, for the LogEntry
model rely on the timestamp field. Adding an index will ensure
reasonable scalability for large audit logs.
* enable use of replica database
When you use replica database the django-auditlog try to write in the same database where object was read (replica). But this is a read only database and crash the application.
This changes saves always in the default database.
If you want to save in multiple databases or in a special one use `DATABASE_ROUTERS` to configure it.
Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
The `django-jsonfield` module is not maintained anymore and raises some
errors with Django 4.0. So, as a recommendation in this package, and as
Django 2.2 is still maintained, `django-jsonfield-backport` will do the
job for the `JSONField` field.
Ref #43
Ref #334
For some applications the possibility to filter by the `action` field might be really interesting. However the lack of an index can lead to severe reduction of such queries.
The simplest solution: Let's a DB index on that field :)