fix: refactor index_together to indexes for Django 5.2 support

This commit is contained in:
Daniel Wong
2025-05-14 16:56:54 -06:00
parent 8c8a567dd0
commit a80523b936
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