Simplified icon of a database stack with a "plus" sign at the bottom

Update Commands

The purpose of the update commands is to apply new database changes that you have specified in the changelog.

When an update command is executed, Liquibase read the changesets in the changelog file and then compares the unique identifiers of id, author, and path to the filename to the values stored in the DATABASECHANGELOG table. If the unique identifiers do not exist in the DATABASECHANGELOG table, Liquibase applies the changes to the database.

Update Commands

These commands are available in all Liquibase editions:

  • update: use this to deploy all new changes.
  • update-sql: run this before the update command to inspect the raw SQL for potential issues.
  • update-count: use this to deploy a specified number of changes in sequential order.
  • update-count-sql: run this before the update-count command to inspect the raw SQL for potential issues.
  • update-to-tag: use this to deploy changes from the newest change in the changelog is reached.
  • update-to-tag-sql: run this before the update-to-tag command to inspect the raw SQL for potential issues.
  • update-testing-rollback: tests rollback support by deploying pending changesets, running a sequential rollback for those changesets, then runs the update again to deploy the changesets.

Since update commands change the schema of a database, Liquibase provides SQL output commands that you can run beforehand. The SQL output commands let you inspect the SQL that Liquibase will generate when you run the update commands.

Additional Commands for Liquibase Pro

These commands require an active Liquibase Pro license:

  • update-one-changeset: use this to deploy one specific changeset without affecting other undeployed changesets.
  • update-one-changeset-sql: execute this before the update-one-changeset command to inspect the raw SQL for potential issues.

Each individual update command page specifies the criteria for using the command successfully, including a list of required and optional command-specific arguments.

Update Command Requirements

All update commands require the following command arguments:

  • The root changelog file is specified as --changelog-file.
  • The JDBC database connection URL is specified as --url.

Your database may also require the --username and --password arguments in Liquibase. However, the username and password are not required for connections and systems which use alternate means of authentication.

Troubleshooting

If Liquibase returns an error when you run an update command, use the Liquibase --help parameter to check the correct syntax of the command and the command-specific parameters you can use with it.

For example, in the CLI:

liquibase <command> --help

Related Content

  • Visit the Using JDBC URL in Liquibase documentation page to learn more about Liquibase database connection requirements.
  • Visit the Liquibase Pro Update Report documentation page to learn more about generating an operational report using the update, update-count, update-to-tag, and update-one-changeset commands. Requires an active Liquibase Pro license and Liquibase version 4.25.1 and later.

Liquibase Resources

Liquibase Help

Visit the Liquibase Forum to ask questions, find answers from other Liquibase users, and learn about new Liquibase version releases.

Tutorials

Visit the documentation tutorial Updating the Database to learn how Liquibase applies database changes.