Add index on RewardCampaign for ends_at and starts_at fields; update tests for index verification

This commit is contained in:
Joakim Hellsén 2026-04-12 03:09:21 +02:00
commit 61946f8155
Signed by: Joakim Hellsén
SSH key fingerprint: SHA256:/9h/CsExpFp+PRhsfA0xznFx2CGfTT5R/kpuFfUgEQk
3 changed files with 115 additions and 2 deletions

View file

@ -0,0 +1,22 @@
# Generated by Django 6.0.4 on 2026-04-11 22:41
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
"Add an index on the RewardCampaign model for the ends_at and starts_at fields, to optimize queries that filter by these fields."
dependencies = [
("twitch", "0019_dropcampaign_campaign_list_indexes"),
]
operations = [
migrations.AddIndex(
model_name="rewardcampaign",
index=models.Index(
fields=["ends_at", "-starts_at"],
name="tw_reward_ends_starts_idx",
),
),
]