updateCount <value> command

The updateCount <value> command updates a specified number of changesets, where <value> is the number of changesets you want to update sequentially on your database.


The updateCount <value> 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 <value> helper command because it allows you to inspect the updateCount <value> SQL, so you can correct any issues that may arise before running the command.

Running the updateCount <value> command

To run the updateCount <value> command, you need to specify your driver, class path, and URL in your liquibase.properties file. You can also specify these in your command line.

Then run the updateCount <value> command:

liquibase --changeLogFile=myChangelog.xml updateCount 2

Note: Enter the name of the changelog and number you want to use in place of myChangelog.xml and 2.

updateCount <value> global attributes

Attribute Definition Requirement
--changeLogFile * The root changelog Required
--url The JDBC database connection URL Required
--username The database username Required
--password The database password Required

* Liquibase will check nested changelogs for definitions of the changesets to update.

updateCount <value> command attributes

Attribute Definition Requirement
<number> The integer indicating the number of changes you want to update Required