tagExists <tag string>
command
The tagExists <tag string>
command checks whether the tag you specify already exists in your database.
Uses
The tagExists <tag string>
command is typically used to identify whether the specified tag exists in the database or specifically in the DATABASECHANGELOG table. Running the tagExists <tag string>
command checks for the tag and, based on whether it exists or not, provides the appropriate output.
Running the tagExists <tag string>
command
To run the tagExists <tag string>
command, you can specify the driver, classpath, and URL in your liquibase.properties
file. For more information, see Creating and configuring a liquibase.properties file. You can also specify these properties in your command line.
Then run the tagExists <tag string>
command:
liquibase --changeLogFile=communityOnly.xml tagExists myTag
Note: Enter the name of the changelog and the tag that you want to use in place of communityOnly.xml
and myTag
.
tagExists <tag string>
global attributes
Attribute |
Definition |
Requirement |
|
The root changelog |
Required |
|
The JDBC database connection URL |
Required |
|
The database username |
Required |
|
The database password |
Required |
tagExists <tag string>
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 |

Depending on the availability of the specified tag, there are two possible outputs.
The first example shows that the tag exists in your database.
Liquibase Pro 3.10.0 by Datical licensed to Liquibase Pro Customer until Tue Nov 03 19:00:00 CST 2020
The tag 'myTag' already exists in 'daticaluser1@jdbc:postgresql://localhost:5433/goku'.
Liquibase command 'tagExists' was executed successfully.
The following example indicates that the tag is not in the database.
Liquibase Pro 3.10.0 by Datical licensed to Liquibase Pro Customer until Tue Nov 03 19:00:00 CST 2020
The tag 'notMyTag' does NOT exist in 'daticaluser1@jdbc:postgresql://localhost:5433/goku'.
Liquibase command 'tagExists' was executed successfully.