Liquibase - Waiting for changelog lock

Waiting for changelog lock....

Running the migration script for a database may produce this:

...

INFO … Liquibase: Waiting for changelog lock....

INFO … Liquibase: Waiting for changelog lock....

INFO … Liquibase: Waiting for changelog lock....

...

To see which machine has locked the database, execute the following SQL query:

USE [Database Name]

SELECT * FROM DATABASECHANGELOGLOCK;

Check the lockedby column to see who locked the table. Generally, the lock will be from the local machine.

If this is the case (and no other machine has a lock on the database), the record should be updated by executing the following query:

UPDATE DATABASECHANGELOGLOCK

SET locked=0, lockgranted=null, lockedby=null

WHERE id=1

After updating this record the migration script should run again without any problems.