update-to-tag-sql

The update-to-tag-sql command is a helper command that inspects the SQL Liquibase will run while using the update-to-tag command.

Uses

The update-to-tag-sql command is used to inspect the raw SQL before running the update-to-tag command, so you can correct any issues that may arise before running the command. Liquibase uses the raw SQL to apply database changes you have added to the changelog file based on the tag specified.

Running the update-to-tag-sql command

To run the update-to-tag-sql command, specify the driver, classpath, and URL in the Liquibase properties file. You can also specify them from the command line.

Then run the update-to-tag-sql command:

liquibase --changelog-file=communityOnly.xml update-to-tag-sql myTag

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

update-to-tag-sql global attributes

Tip: All commands and parameters use the --kebab-case format in the CLI environment. This is the format Liquibase recommends for best results. If your preference is camelCase, it will still work in the CLI.

Attribute

Definition

Requirement

--changelog-file *

Specifies the root changelog

Required

--url

Specifies the JDBC database connection URL

Required

--username

Specifies the database username

Required

--password

Specifies the database password

Required

--output-file **

Specifies the file path to where the update-to-tag SQL will be written

Optional

*Liquibase checks the changelog and any nested changelogs for the definitions of the changesets to update.

** If not specified, the update-to-tag SQL output goes to STDOUT.

Note: The username and password attributes are not required for connections and systems which use alternate means of authentication.

update-to-tag-sql command attributes

Attribute Definition Requirement

<tag>

Tags allow the user to identify which changesets in the changelog to evaluate.

Required