Skip to content
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
merged 1 commit into from
Nov 5, 2024

Conversation

bakulf
Copy link
Contributor

@bakulf bakulf commented Oct 31, 2024

Fixes: mozilla/addons#15111

Description

This patch does the following:

  • Introduce PositiveTinyIntegerField to support tinyint unsigned fields
  • Rename soft to block_type via 2 separate migrations (add + remove)
  • Introduce the BlockType enum and use it instead of the soft boolean
  • Unify the string versions of enum values

Context

The first BlockVersion.soft implementation used a boolean field type. For readability and future improvement, this PR replaces it with an enum and uses a tinyint 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

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
  • Add before and after screenshots (Only for changes that impact the UI).
  • Add or update relevant docs reflecting the changes made.

@bakulf bakulf requested review from diox and KevinMind October 31, 2024 15:17
@bakulf bakulf force-pushed the positiveTinyInteger branch 2 times, most recently from e6029c8 to 83a9047 Compare October 31, 2024 15:26
@bakulf bakulf force-pushed the positiveTinyInteger branch 2 times, most recently from 280accb to c60254d Compare November 4, 2024 17:49
Copy link
Contributor

@KevinMind KevinMind left a 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 bakulf merged commit 6d7474e into master Nov 5, 2024
31 checks passed
@bakulf bakulf deleted the positiveTinyInteger branch November 5, 2024 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task]: Migrate from BlockVersion.soft to BlockVersion.block_type
3 participants