updateToTagSQL <tag>
command
The updateToTagSQL <tag>
command is a helper command that inspects the SQL Liquibase will run while using the updateToTag <tag>
command.
Uses
The updateToTagSQL <tag>
command is used to inspect the raw SQL before running the updateToTag <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 updateToTagSQL <tag>
command
To run the updateToTagSQL <tag>
command, you can specify the driver, classpath, and URL in your liquibase.properties
file. You can also specify these in your command line.
Then run the updateToTagSQL
command:
liquibase --changeLogFile=communityOnly.xml updateToTagSQL myTag
Note: Enter the name of the changelog and the tag that you want to use in place of communityOnly.xml
and myTag
.
updateToTagSQL <tag>
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 updateToTag 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 updateToTag SQL output goes to STDOUT
.
updateToTagSQL <tag>
command attributes
Attribute | Definition | Requirement |
---|---|---|
|
The tag you can add to changesets to determine which changesets in the changelog to evaluate based on their tags. |
Required |

Liquibase Pro 4.0.0-beta2-LB-337-SNAPSHOT by Datical licensed to Liquibase Pro Customer until Tue Nov 03 19:00:00 CST 2020
Starting Liquibase at 15:24:52 (version 4.0.0-beta2-LB-337-SNAPSHOT #2 built at 2020-06-23 19:48+0000)
-- *********************************************************************
-- Update to 'myTag' Database Script
-- *********************************************************************
-- Change Log: communityOnly.xml
-- Ran at: 6/24/20 3:24 PM
-- Against: daticaluser1@jdbc:postgresql://localhost:5433/goku
-- Liquibase version: 4.0.0-beta2-LB-337-SNAPSHOT
-- *********************************************************************
-- Lock Database
UPDATE public.databasechangeloglock SET LOCKED = TRUE, LOCKEDBY = 'gemfire-PC (192.168.1.11)', LOCKGRANTED = '2020-06-24 15:24:53.143' WHERE ID = 1 AND LOCKED = FALSE;
-- Changeset communityOnly.xml::1::table::liquibase-user
CREATE TABLE public.testtable1 (supplier_id numeric(4), supplier_name VARCHAR(50));
INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1::table', 'liquibase-user', 'communityOnly.xml', NOW(), 17, '8:ee450cb25c1ea559c9ea2739ccc6d188', 'createTable tableName=testtable1', '', 'EXECUTED', NULL, 'community', '4.0.0-b2-LB-337-SNP', NULL);
-- Changeset communityOnly.xml::2::view::liquibase-user
CREATE VIEW testview1 AS SELECT supplier_name FROM public.testtable1 ORDER BY supplier_name DESC;
INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('2::view', 'liquibase-user', 'communityOnly.xml', NOW(), 18, '8:0bbc77136002c3c404a58374eaa53e1a', 'createView viewName=testview1', '', 'EXECUTED', NULL, 'community', '4.0.0-b2-LB-337-SNP', NULL);
-- Changeset communityOnly.xml::1::tag-u-r-it::liquibase-user
INSERT INTO public.databasechangelog (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID, TAG) VALUES ('1::tag-u-r-it', 'liquibase-user', 'communityOnly.xml', NOW(), 19, '8:c127b1d9055bf9cec910a6928087db65', 'tagDatabase', '', 'EXECUTED', NULL, 'tagme', '4.0.0-b2-LB-337-SNP', NULL, 'myTag');
-- Release Database Lock
UPDATE public.databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;
Liquibase command 'updateToTagSQL' was executed successfully.