Closed rwrz closed 1 year ago
I've merged the regex, but forgot to remove another fix that I'm using here. This fix is to consider the "field type aliases" when checking if the column type has changed. Mostly because we rely on those aliases for cockroachdb compatibility, but I believe it is also important for PostgreSQL.
What did this pull request do?
Currently, CockroachDB returns
:::int8
together with their default values. We have a regex to remove it, that solves issues with PostgreSQL values, but it doesn't solve cockroachdb ones. So, I'm adding another regex to fix it. Also, column field types has aliases, and the migrator check them to decide if we need to ALTER a column or not. But the driver is not checking it, so, I'm adding this alias check as well.User Case Description
You can test this this model:
It would trigger the ALTER COLUMN every time since
int
returnsint8
and wasn't considering the alias tobigint
. Also, it would have issues with thedefault:0
, since it would check against0:::int8
and0
.