refactor: remove UUID field from ComponentVersionContent#404
Merged
ormsbee merged 1 commit intoopenedx:mainfrom Oct 2, 2025
Merged
refactor: remove UUID field from ComponentVersionContent#404ormsbee merged 1 commit intoopenedx:mainfrom
ormsbee merged 1 commit intoopenedx:mainfrom
Conversation
It's wasteful to have a UUID on this join table, as we already have a unique way to address everything in it by the unique combination of the ComponentVersion (PublishableEntityVersion) and the ComponentVersionContent.key (file path). Dropping this column may cause transient errors for some sites if someone is creating components after the column was dropped, but before the new app code is live. UUIDs are generated on the Python side, so Django will try to generate a UUID to put into a column that has already been dropped on the database side. That being said, this window of time should be small, and this feature is not in widespread use yet. I don't think a more complex migration is warranted.
14533fe to
86bb7b3
Compare
bradenmacdonald
approved these changes
Oct 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
It's wasteful to have a UUID on this join table, as we already have
a unique way to address everything in it by the unique combination
of the ComponentVersion (PublishableEntityVersion) and the
ComponentVersionContent.key (file path).
Dropping this column may cause transient errors for some sites if
someone is creating components after the column was dropped, but
before the new app code is live. UUIDs are generated on the Python
side, so Django will try to generate a UUID to put into a column
that has already been dropped on the database side.
That being said, this window of time should be small, and this
feature is not in widespread use yet. I don't think a more complex
migration is warranted.