add USING ?::? to `AlterColumn`
What did this pull request do?
Add USING ?::? to AlterColumn Without this, it will report error as I described in the issue #104
User Case Description
We used migrator to change column data type
LGTM if column without default value. Maybe we need to add conditions, use
Usingwhen no implicit (automatic) cast and change thedefalut value
Sounds great, I will modify it and submit again
I did some shallow research, it's hard to add conditions. Cause there are too many data types. time <-> varchar, int <-> varchar longtext <-> int, varchar and so on
I don't know whether Using has side effects. If not, we can drop default value first when type changes and add it after completion. We can also judge whether to execute the above process through the error code.
I don't know whether
Usinghas side effects. If not, we can drop default value first when type changes and add it after completion. We can also judge whether to execute the above process through the error code.
It's a better way to execute the above process according to the error code. If it's ok, I can do it
it is still broken.
if the column is of part of the partition definition you'll get ERROR: cannot alter type of column named in partition key (SQLSTATE 42P16)