Is there a way to add lock from command line?

There isn’t a command line prompt to lock the database, but I could see it being helpful. I created so the feature doesn’t get lost.

For now, you could call out to the java APIS: LockServiceFactory.getInstance().getLockService(database).lock() or something similar.

Or, you could create the databasechangeloglock table yourself and set the LOCKED column to 1. That is all liquibase uses to track the lock.



our development lifecycle includes the following steps:

  1. create a clean DB

  2. copy the schema + subset of data from prod

  3. run liquibase update

Step 2 takes something like 2 hours, and the easiest would be to be able to do something like liquibase lock "DB is being copied from prod" before it, and liquibase releaseLocks after it, so that noone could accidentally start step 3 too early.