Add index on RewardCampaign for ends_at and starts_at fields; update tests for index verification
This commit is contained in:
parent
47d4f5341f
commit
61946f8155
3 changed files with 115 additions and 2 deletions
|
|
@ -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",
|
||||
),
|
||||
),
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue