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

Fix changing boolean column option's in postgresql #2027

Merged
merged 1 commit into from
Oct 12, 2021

Conversation

MasterOdin
Copy link
Member

Fixes #2017

This PR fixes a regression introduced in #1974 where attempting to edit a boolean column's options would cause an exception. This exception is caused where as part of setting the default value
#1974 introduced a regression where attempting to edit any boolean option would cause an exception to be thrown due to invalid comparison where we tried to do column_name=0 as postgresql does not recognize boolean = integer comparisons. To fix it, we add a cast on the column to integer before doing the comparison, which works fine on boolean columns. On this, the PR fixes a secondary bug where null values in columns being converted to boolean would have null values casted to true.

Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
@MasterOdin MasterOdin force-pushed the mpeveler/bugfix-postgresql-boolean branch from 57bb1ea to 0c060ec Compare October 12, 2021 10:39
@dereuromark dereuromark merged commit 5a0146a into master Oct 12, 2021
@MasterOdin MasterOdin deleted the mpeveler/bugfix-postgresql-boolean branch October 12, 2021 10:49
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.

0.12.8 introduced Postgres regression: cannot change boolean column's null option
2 participants