-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate from BlockVersion.soft to BlockVersion.block_type #22811
Merged
Conversation
This file contains 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
bakulf
force-pushed
the
positiveTinyInteger
branch
2 times, most recently
from
October 31, 2024 15:26
e6029c8
to
83a9047
Compare
KevinMind
reviewed
Oct 31, 2024
src/olympia/blocklist/migrations/0038_remove_blockversion_soft.py
Outdated
Show resolved
Hide resolved
KevinMind
reviewed
Oct 31, 2024
5 tasks
KevinMind
reviewed
Nov 1, 2024
src/olympia/blocklist/migrations/0036_blocklistsubmission_block_type_and_more.py
Outdated
Show resolved
Hide resolved
KevinMind
reviewed
Nov 1, 2024
src/olympia/blocklist/migrations/0038_remove_blockversion_soft.py
Outdated
Show resolved
Hide resolved
bakulf
force-pushed
the
positiveTinyInteger
branch
2 times, most recently
from
November 4, 2024 17:49
280accb
to
c60254d
Compare
KevinMind
reviewed
Nov 4, 2024
src/olympia/blocklist/migrations/0037_alter_blockversion_block_type_and_more.py
Outdated
Show resolved
Hide resolved
bakulf
force-pushed
the
positiveTinyInteger
branch
2 times, most recently
from
November 4, 2024 20:35
2e125c0
to
e68100d
Compare
5 tasks
bakulf
force-pushed
the
positiveTinyInteger
branch
from
November 4, 2024 21:07
e68100d
to
ee25d84
Compare
KevinMind
approved these changes
Nov 5, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀 (run make lint and fix the long line issue)
This patch does the following: - Introduce `PositiveTinyIntegerField` to support `tinyint unsigned` fields - Rename `soft` to `block_type` via 2 separate migrations (add + remove) - Introduce `BlockType` enum and use it instead of the `soft` boolean - Unify the string versions of enum values
bakulf
force-pushed
the
positiveTinyInteger
branch
from
November 5, 2024 10:07
ee25d84
to
1d89978
Compare
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.
Fixes: mozilla/addons#15111
Description
This patch does the following:
PositiveTinyIntegerField
to supporttinyint unsigned
fieldssoft
toblock_type
via 2 separate migrations (add + remove)BlockType
enum and use it instead of thesoft
booleanContext
The first
BlockVersion.soft
implementation used a boolean field type. For readability and future improvement, this PR replaces it with an enum and uses atinyint
data type, which is the same size as a boolean in MySQL.Testing
No new tests are added, but all the existing tests are updated to use the new enum.
Checklist
#ISSUENUM
at the top of your PR to an existing open issue in the mozilla/addons repository.