-
-
Notifications
You must be signed in to change notification settings - Fork 125
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 : fail to alter existing boolean column from smallint with default value to boolean in postgres (#180) #181
Conversation
…t value to boolean in postgres (go-gorm#180)
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.
Is it also deleted when automatic transformation is allowed? like smallint -> bigint
ok, I've fixed it with |
Can we combine genUsingExpression and isUncastableDefaultValue? They will only work if you need to specify the conversion type. pseudo code if specifiedType, isAuto := autoConversion(...); !isAuto {
// delete if has default value
// use `USING column::xxx::xxx`
} else {
// use `USING column::xxx`
} |
i have fixed it using |
OK, I've fixed it to |
Can you fix the conflict? thank you. |
✅ Done |
What did this pull request do?
drop existing default value to
AlterColumn
before change column type.Without this, it will report error as I described in the issue #180
User Case Description
We used migrator to change column data type