Skip to content

Commit b7835d4

Browse files
authored
Add date version index on build (#11612)
Fixes readthedocs/ext-theme#463
1 parent 31e8371 commit b7835d4

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Generated by Django 4.2.16 on 2024-09-23 18:18
2+
3+
from django.db import migrations, models
4+
from django_safemigrate import Safe
5+
6+
7+
class Migration(migrations.Migration):
8+
safe = Safe.always
9+
dependencies = [
10+
("builds", "0058_alter_version_created_alter_version_modified"),
11+
]
12+
13+
operations = [
14+
migrations.AddIndex(
15+
model_name="build",
16+
index=models.Index(
17+
fields=["version", "date"], name="builds_buil_version_259bbf_idx"
18+
),
19+
),
20+
]

readthedocs/builds/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ class Meta:
846846
]
847847
indexes = [
848848
models.Index(fields=["project", "date"]),
849+
models.Index(fields=["version", "date"]),
849850
]
850851

851852
def __init__(self, *args, **kwargs):

0 commit comments

Comments
 (0)