diff --git a/readthedocs/builds/migrations/0059_add_version_date_index.py b/readthedocs/builds/migrations/0059_add_version_date_index.py new file mode 100644 index 00000000000..180adae1729 --- /dev/null +++ b/readthedocs/builds/migrations/0059_add_version_date_index.py @@ -0,0 +1,20 @@ +# Generated by Django 4.2.16 on 2024-09-23 18:18 + +from django.db import migrations, models +from django_safemigrate import Safe + + +class Migration(migrations.Migration): + safe = Safe.always + dependencies = [ + ("builds", "0058_alter_version_created_alter_version_modified"), + ] + + operations = [ + migrations.AddIndex( + model_name="build", + index=models.Index( + fields=["version", "date"], name="builds_buil_version_259bbf_idx" + ), + ), + ] diff --git a/readthedocs/builds/models.py b/readthedocs/builds/models.py index b11ea8ee406..25940a8bb99 100644 --- a/readthedocs/builds/models.py +++ b/readthedocs/builds/models.py @@ -846,6 +846,7 @@ class Meta: ] indexes = [ models.Index(fields=["project", "date"]), + models.Index(fields=["version", "date"]), ] def __init__(self, *args, **kwargs):