I am trying to find out what are the best ways to test liquibase changes in CI.
Here is some info on our CI environment:
-All CI builds are running against 1 schema (We would like to move 1 build per schema)
-Multiple builds could be running concurrently
My goal is to only test the new scripts that are checked in. It should be noop if no liquibase changes were checked in.
What I thought originally was executing the following with no prompt flag:
mvn liquibase:tag -Dliquibase.tag=$TIMESTAMP
mvn liquibase:rollback -Dliquibase.rollbackTag=$TIMESTAMP
However, I am concerned that if multiple builds are running on the same schema, the TIMESTAMP from two builds would step on each other. Anyway I could work around that before schema becomes non-shared.
Note that I think I need to use $TIMESTAMP because static tag could cause extra work to be done by liquibase.
For example, if my DATABASECHANGELOG looks like the following,
mvn liquibase:rollback -Dliquibase.rollbackTag=TEST would rollback 4 and 3, and what I want is to rollback nothing. In addition, there is no option to remove tag, so the situation seems inevitable.