-
Notifications
You must be signed in to change notification settings - Fork 886
fix: do not skip parameter validation if min or max = 0 #7707
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
Changes from all commits
2902f8a
aaabe5b
d2d8818
d507f9d
d70145a
5497215
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
BEGIN; | ||
UPDATE template_version_parameters SET validation_min = 0 WHERE validation_min = NULL; | ||
UPDATE template_version_parameters SET validation_max = 0 WHERE validation_max = NULL; | ||
ALTER TABLE template_version_parameters ALTER COLUMN validation_min SET NOT NULL; | ||
ALTER TABLE template_version_parameters ALTER COLUMN validation_max SET NOT NULL; | ||
COMMIT; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
BEGIN; | ||
ALTER TABLE template_version_parameters ALTER COLUMN validation_min DROP NOT NULL; | ||
ALTER TABLE template_version_parameters ALTER COLUMN validation_max DROP NOT NULL; | ||
UPDATE template_version_parameters SET validation_min = NULL WHERE validation_min = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thinking out loud, what if someone has explicitly specified min to be 0 so that -1 can't be used? This seems like a potentially lossy migration and we should probably wait until templates are updated to receive their new, null value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not worse than what we have today, because we treat min=0 as disabling validation! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, didn't realize. That's both surprising and worrying, glad it's getting fixed. 😄 |
||
UPDATE template_version_parameters SET validation_max = NULL WHERE validation_max = 0; | ||
COMMIT; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
On the other hand, the lossyness here seems fine.