diff --git a/lms/djangoapps/coursewarehistoryextended/migrations/0003_rename_studentmodulehistoryextended_student_module_student_module_idx.py b/lms/djangoapps/coursewarehistoryextended/migrations/0003_rename_studentmodulehistoryextended_student_module_student_module_idx.py new file mode 100644 index 0000000000..c39e2410b5 --- /dev/null +++ b/lms/djangoapps/coursewarehistoryextended/migrations/0003_rename_studentmodulehistoryextended_student_module_student_module_idx.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.20 on 2025-05-15 03:30 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('coursewarehistoryextended', '0002_force_studentmodule_index'), + ] + + operations = [ + migrations.RenameIndex( + model_name='studentmodulehistoryextended', + new_name='student_module_idx', + old_fields=('student_module',), + ), + ] diff --git a/lms/djangoapps/coursewarehistoryextended/models.py b/lms/djangoapps/coursewarehistoryextended/models.py index 37de4a93ab..d9e2d54cca 100644 --- a/lms/djangoapps/coursewarehistoryextended/models.py +++ b/lms/djangoapps/coursewarehistoryextended/models.py @@ -33,7 +33,12 @@ class StudentModuleHistoryExtended(BaseStudentModuleHistory): class Meta: app_label = 'coursewarehistoryextended' get_latest_by = "created" - index_together = ['student_module'] + indexes = [ + models.Index( + fields=['student_module'], + name="student_module_idx" + ), + ] id = UnsignedBigIntAutoField(primary_key=True) # pylint: disable=invalid-name