Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix potential slow query on huge requestevent table #240

Merged
merged 1 commit into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions easyaudit/migrations/0017_alter_requestevent_datetime.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.1.1 on 2022-09-25 00:19

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('easyaudit', '0016_alter_crudevent_event_type'),
]

operations = [
migrations.AlterField(
model_name='requestevent',
name='datetime',
field=models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='Date time'),
),
]
2 changes: 1 addition & 1 deletion easyaudit/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class RequestEvent(models.Model):
on_delete=models.SET_NULL, db_constraint=False,
verbose_name=_('User'))
remote_ip = models.CharField(max_length=50, null=True, db_index=True, verbose_name=_('Remote IP'))
datetime = models.DateTimeField(auto_now_add=True, verbose_name=_('Date time'))
datetime = models.DateTimeField(auto_now_add=True, db_index=True, verbose_name=_('Date time'))

class Meta:
verbose_name = _('request event')
Expand Down