The tagDatabase Change Type applies a tag to the database for future update or rollback.


You can typically use the tagDatabase Change Type when you want to tag your current database state, release, or version, and then deploy new changesets to that tag or roll back changesets applied after that tag. If you deploy a tagDatabase changeset from your changelog, it adds a new row to the DATABASECHANGELOG table. This row will have the tag name specified in that changeset.

When you run the update-to-tag command or the Maven update goal with the liquibase.toTag attribute, and there is a row in the DATABASECHANGELOG table corresponding to the tagDatabase changeset in the changelog, the update-to-tag command or the update Maven goal deploys all changesets starting with the first changeset at the top of the changelog file and moving down to the changeset up to the tag specified by the tagDatabase Change Type.

When you want to roll back changesets deployed after the tagDatabase Change Type, the rollback command or the Maven rollback goal with the liquibase.rollbackTag attribute will remove your changesets and the tagDatabase row specified with the rollback command or goal.

Note: The XSD doesn't allow the tagDatabase Change Type to be used with another Change Types in the same changeset.

Running the tagDatabase Change Type

To run this Change Type, follow these steps:

  1. Add the Change Type to your changeset, as shown in the examples on this page.
  2. Specify any required attributes. Use the table on this page to see which ones your database requires.
  3. Deploy your changeset by running the update command:
  4. liquibase update

Now, you should see that the tag has been applied to the DATABASECHANGELOG table as a new changeset row.

Available attributes

Name Description Required for Supports
tag The tag to apply all all


        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd
        http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd">

    <changeSet  author="liquibase-docs"  id="tagDatabase-example">
        <tagDatabase  tag="version_1.3"/>

-  changeSet:
    id:  tagDatabase-example
    author:  liquibase-docs
    -  tagDatabase:
        tag:  version_1.3
    "databaseChangeLog": [
            "changeSet": {
                "id": "tagDatabase-example",
                "author": "liquibase-docs",
                "changes": [
                        "tagDatabase": {
                            "tag": "version_1.3"

Database support

Database Notes Auto Rollback
DB2/LUW Supported Yes
DB2/z Supported Yes
Derby Supported Yes
Firebird Supported Yes
H2 Supported Yes
HyperSQL Supported Yes
INGRES Supported Yes
Informix Supported Yes
MariaDB Supported Yes
MySQL Supported Yes
Oracle Supported Yes
PostgreSQL Supported Yes
Snowflake Supported Yes
SQL Server Supported Yes
SQLite Supported Yes
Sybase Supported Yes
Sybase Anywhere Supported Yes