Skip to content

Commit af5faf4

Browse files
authored
fix: refactor index_together to indexes for Django 5.2 support (#36702)
1 parent 2ba9b79 commit af5faf4

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 4.2.20 on 2025-05-12 13:39
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('grades', '0020_alter_historicalpersistentsubsectiongradeoverride_options'),
10+
]
11+
12+
operations = [
13+
migrations.RenameIndex(
14+
model_name='persistentcoursegrade',
15+
new_name='passed_timestamp_course_id_idx',
16+
old_fields=('passed_timestamp', 'course_id'),
17+
),
18+
migrations.RenameIndex(
19+
model_name='persistentcoursegrade',
20+
new_name='modified_course_id_idx',
21+
old_fields=('modified', 'course_id'),
22+
),
23+
]

lms/djangoapps/grades/models.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,9 @@ class Meta:
569569
unique_together = [
570570
('course_id', 'user_id'),
571571
]
572-
index_together = [
573-
('passed_timestamp', 'course_id'),
574-
('modified', 'course_id')
572+
indexes = [
573+
models.Index(fields=['passed_timestamp', 'course_id'], name="passed_timestamp_course_id_idx"),
574+
models.Index(fields=['modified', 'course_id'], name="modified_course_id_idx")
575575
]
576576

577577
# primary key will need to be large for this table

0 commit comments

Comments
 (0)