fix: Convert UUIDField columns to uuid type for Mariadb #37966
+74
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The behavior of the MariaDB backend has changed behavior for UUIDField from a
CharField(32)to an actualuuidtype. This is not converted automatically, which results in all writes to the affected columns to error with a message about the data being too long. This is because the actual string being written is a UUID with the-included, resulting in a 36 character value which can't be inserted into a 32 character column.Supporting information
https://docs.djangoproject.com/en/5.2/releases/5.0/#migrating-uuidfield
Testing instructions
Configure edx-platform to use a MariaDB database as well as the work necessary to use Libraries V2 (meilisearch, etc), run the migrations up through the Django 5.2 update, then perform the 5.2 update and try to create a new V2 Library. It will error. After applying these migrations it should work.
Deadline
This is a blocking error that prevents the LibrariesV2 from being operational when using MariaDB as the database engine.
Other information
This is in addition to the migrations found in PR #37494