Skip to content

Commit

Permalink
Merge pull request #1094 from opengisch/QF-5021-index-authtoken-creat…
Browse files Browse the repository at this point in the history
…ed_at

Speed-up opening the authentication.authtoken admin by indexing `created_at` column
  • Loading branch information
suricactus authored Dec 29, 2024
2 parents c33f5dc + cffee2a commit 2672a1f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.16 on 2024-12-29 12:55

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("authentication", "0002_alter_authtoken_client_type"),
]

operations = [
migrations.AddIndex(
model_name="authtoken",
index=models.Index(
fields=["created_at"], name="authenticat_created_ee68f9_idx"
),
),
]
1 change: 1 addition & 0 deletions docker-app/qfieldcloud/authentication/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class Meta:
verbose_name = _("Token")
verbose_name_plural = _("Tokens")
ordering = ("-created_at",)
indexes = (models.Index(fields=["created_at"]),)

def __str__(self):
return self.key
Expand Down

0 comments on commit 2672a1f

Please sign in to comment.