Description
Migration 0006_mariadb_uuid_conversion (added in v3.12.1 via PR #321) attempts to modify uuid columns in three tables, but two of those tables don't have uuid columns:
The Problem
The migration executes these SQL statements on MariaDB:
ALTER TABLE submissions_submission MODIFY uuid uuid NOT NULL -- ✅ This column EXISTS
ALTER TABLE submissions_studentitem MODIFY uuid uuid NOT NULL -- ❌ This column does NOT exist
ALTER TABLE submissions_score MODIFY uuid uuid NOT NULL -- ❌ This column does NOT exist
Evidence from models.py
Looking at submissions/models.py, only these models have UUID fields:
| Model |
Has uuid field? |
Submission |
✅ Yes - line 315: uuid = models.UUIDField(...) |
TeamSubmission |
✅ Yes - line 128: uuid = models.UUIDField(...) |
SubmissionFile |
✅ Yes - line 753: uuid = models.UUIDField(...) |
StudentItem |
❌ No - only has student_id, course_id, item_id, item_type |
Score |
❌ No - only has foreign keys and score fields |
Error Message
When running migrations on a fresh Open edX Ulmo installation with MariaDB:
django.db.utils.OperationalError: (1054, "Unknown column 'uuid' in 'submissions_studentitem'")
Applying submissions.0006_mariadb_uuid_conversion...
Environment
- Open edX: Ulmo (December 2025)
- Tutor: 21.x
- edx-submissions: 3.12.1
- Database: MariaDB 10.11.x
- Django: 5.x
Suggested Fix
The migration should only modify submissions_submission table, since that's the only table with a uuid column that needs conversion:
def apply_mariadb_migration(apps, schema_editor):
# ... MariaDB check code ...
with connection.cursor() as cursor:
# Only Submission model has uuid field
cursor.execute(
"ALTER TABLE submissions_submission "
"MODIFY uuid uuid NOT NULL"
)
# Remove StudentItem and Score - they don't have uuid columns
Workaround
For anyone encountering this issue, you can fake the migration:
./manage.py lms migrate submissions 0006_mariadb_uuid_conversion --fake
This is safe because:
submissions_submission.uuid is already created as native uuid type with Django 5
StudentItem and Score don't have uuid columns in the model definition
Related
Description
Migration
0006_mariadb_uuid_conversion(added in v3.12.1 via PR #321) attempts to modifyuuidcolumns in three tables, but two of those tables don't have uuid columns:The Problem
The migration executes these SQL statements on MariaDB:
Evidence from models.py
Looking at
submissions/models.py, only these models have UUID fields:Submissionuuid = models.UUIDField(...)TeamSubmissionuuid = models.UUIDField(...)SubmissionFileuuid = models.UUIDField(...)StudentItemstudent_id,course_id,item_id,item_typeScoreError Message
When running migrations on a fresh Open edX Ulmo installation with MariaDB:
Environment
Suggested Fix
The migration should only modify
submissions_submissiontable, since that's the only table with a uuid column that needs conversion:Workaround
For anyone encountering this issue, you can fake the migration:
This is safe because:
submissions_submission.uuidis already created as nativeuuidtype with Django 5StudentItemandScoredon't have uuid columns in the model definitionRelated