Merge pull request #36722 from dwong2708/dw/index-together

fix: refactor index_together to indexes for Django 5.2 support (V) model: StudentModuleHistoryExtended
This commit is contained in:
Feanil Patel
2025-05-16 09:25:48 -04:00
committed by GitHub
2 changed files with 24 additions and 1 deletions

View File

@@ -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',),
),
]

View File

@@ -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