fix: refactor index_together to indexes for Django 5.2 support (#36702)

This commit is contained in:
Usama Sadiq
2025-05-13 11:06:34 +05:00
committed by GitHub
parent 2ba9b7977f
commit af5faf4965
2 changed files with 26 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
# Generated by Django 4.2.20 on 2025-05-12 13:39
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('grades', '0020_alter_historicalpersistentsubsectiongradeoverride_options'),
]
operations = [
migrations.RenameIndex(
model_name='persistentcoursegrade',
new_name='passed_timestamp_course_id_idx',
old_fields=('passed_timestamp', 'course_id'),
),
migrations.RenameIndex(
model_name='persistentcoursegrade',
new_name='modified_course_id_idx',
old_fields=('modified', 'course_id'),
),
]

View File

@@ -569,9 +569,9 @@ class PersistentCourseGrade(TimeStampedModel):
unique_together = [
('course_id', 'user_id'),
]
index_together = [
('passed_timestamp', 'course_id'),
('modified', 'course_id')
indexes = [
models.Index(fields=['passed_timestamp', 'course_id'], name="passed_timestamp_course_id_idx"),
models.Index(fields=['modified', 'course_id'], name="modified_course_id_idx")
]
# primary key will need to be large for this table