updateToTag <tag> command

The updateToTag <tag> command applies sequential changes to your database from the newest changeset to the changeset with the tag you specify.

Uses

The updateToTag <tag> command is mainly used to apply changes sequentially, starting with the changesets from the top of the changelog file until the specified tag is reached.

Even though there are other undeployed changes in the changelog, the command deploys only the changesets associated with a specific tag.

The image below shows the changelog structure with the following Change Types: two changesets with createTable, the changeset with createView, and the changeset with tagDatabase.

Running the command updateToTag myTag, creates the table, the view, and the tag on the DATABASECHANGELOG table without applying the changeset with createTable b Change Type.

Additionally, the best practice is to run the updateToTagSQL <tag> helper command to inspect the updateToTag <tag> SQL, so you can correct any issues that may arise before running the command.

Running the updateToTag <tag> command

To run the updateToTag <tag> command, you need to specify your driver, class path, URL, and user authentication information in your liquibase.properties file. You can also specify these in your command line.

Then run the updateToTag <tag> command:

--changeLogFile=communityOnly.xml updateToTag myTag

Note: Enter the name of the changelog and the tag that you want to use in place of communityOnly.xml and myTag.

updateToTag <tag> 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 the changelog and any nested changelogs for definitions of the changesets to update.

updateToTag <tag> command attributes

Attribute Definition Requirement

<tag>

The tag you can add to changesets to determine which changesets in the changelog to evaluate based on their tags.

Required