After trying to migrate my database from Oracle to Postgres Liquibase has problems setting the lock because the LOCKED column got converted from NUMBER(1)
to int4
and the update statement is using boolean
which works in Oracle but not in Postgres:
UPDATE databasechangeloglock SET LOCKED = TRUE, LOCKEDBY = '<<<machine name>>>', LOCKGRANTED = '2024-11-01 17:17:38.911' WHERE ID = 1 AND LOCKED = FALSE
which results in the following error:
ERROR: operator does not exist: integer = boolean
My question is whether the only solution would be to convert the LOCKED column in Postgres to boolean
or can the statement be configured in Liquibase?
You need to manually convert that, Liquibase won't fix it for you.