Make GameDetailView faster

This commit is contained in:
Joakim Hellsén 2026-04-12 05:08:40 +02:00
commit 16b12a7035
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
4 changed files with 157 additions and 109 deletions

View file

@ -0,0 +1,22 @@
# Generated by Django 6.0.4 on 2026-04-12 03:06
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
"Add an index on the DropCampaign model for the game and end_at fields, with end_at in descending order. This is to optimize queries that filter by game and order by end_at descending."
dependencies = [
("twitch", "0021_channel_allowed_campaign_count_cache"),
]
operations = [
migrations.AddIndex(
model_name="dropcampaign",
index=models.Index(
fields=["game", "-end_at"],
name="tw_drop_game_end_desc_idx",
),
),
]