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
Attribute |
Definition |
Requirement |
|
Specifies the root changelog |
Required |
|
Specifies the JDBC database connection URL |
Required |
|
Specifies the database username |
Required |
|
Specifies the database password |
Required |
|
Specifies the file path to where the |
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 |
---|---|---|
|
Tags allow the user to identify which changesets in the changelog to evaluate. |
Required |

Liquibase Version: 4.9.1
Liquibase Community 4.9.1 by Liquibase
-- *********************************************************************
-- Update to 'version3' Database Script
-- *********************************************************************
-- Change Log: example-changelog.sql
-- Ran at: 5/9/22, 2:50 PM
-- Against: DBUSER@jdbc:h2:tcp://localhost:9090/mem:dev
-- Liquibase version: 4.9.1
-- *********************************************************************
-- Lock Database
UPDATE PUBLIC.DATABASECHANGELOGLOCK SET LOCKED = TRUE, LOCKEDBY = 'DESKTOP-SQVSSV2 (192.168.1.179)', LOCKGRANTED = NOW() WHERE ID = 1 AND LOCKED = FALSE;
-- Release Database Lock
UPDATE PUBLIC.DATABASECHANGELOGLOCK SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;
Liquibase command 'update-to-tag-sql' was executed successfully.