I accidentally interrupted applying of liquibase
script. Now I get message
Waiting for change log lock...
Table databasechangeloglock
is empty. Also I tried to add row 1 false (null) (null)
, but it didn't help.
I found problem. Lock was in databasechangloglock table in default postgresql database named "postgres".
To list all the changeloglocks in postgres.
select * from databasechangeloglock;
To release a particuler lock.
update databasechangeloglock set locked ='f' where id=<id>;
Confirm with the locked by
column before releasing.
I would highly recommend running the Liquibase commmand "releaseLocks" instead of directly updating the databasechangeloglock table.
The table's data-types and the update statement needed will changes depending on the DBMS platform you are using, but the "releaseLocks" command is universal.
My case is different, after getting locked error, I tried removing lock by setting locked = false but it was not working turns out that I was not committing the update command. -_-
for below query worked
update databasechangeloglock set locked = 'False' where id = <id>;
In My case, I had to update the below query with the schema
UPDATE {schema}.DATABASECHANGELOGLOCK SET LOCKED=false, LOCKGRANTED=null, LOCKEDBY=null where ID=1