updateCount command sequentially updates a specified number of changesets on your database.
updateCount command is mainly used when you want to apply changes and update changesets sequentially, starting with the changesets from the top of the changelog file until the number specified is reached.
The image below shows four changesets: changeset a, changeset b, changeset c, and changeset d. As you can see, changeset a is already deployed on the database. So, running the command
updateCount 2, deploys changeset b and c without applying changeset d.
Additionally, the best practice is to run the
updateCountSQL helper command because it allows you to inspect the
updateCount SQL, so you can correct any issues that may arise before running the command.
To run the
updateCount command, you can specify the driver, classpath, and URL in your
liquibase.properties file. For more information, see Creating and configuring a liquibase.properties file. You can also specify these in your command line.
Then run the
liquibase --changeLogFile=myChangelog.xml updateCount 2
Note: Enter the name of the changelog and number you want to use in place of
updateCount global attributes
||The root changelog||Required|
||The JDBC database connection URL||Required|
||The database username||Required|
||The database password||Required|
* Liquibase will check nested changelogs for definitions of the changesets to update.
password attributes are not required for connections and systems which use alternate means of authentication.
updateCount command attributes
||The integer indicating the number of changes you want to update||Required|
Liquibase Pro 3.10.0-local-SNAPSHOT by Datical licensed to Liquibase Pro Customer until Tue Nov 03 19:00:00 CST 2020 Liquibase command 'updateCount' was executed successfully.