How to tagDatabase on changelogs in SQL Format?

Hello team:

Im just using liquibase for the first time… and so far, I just have one single doubt: how can I use “tags” in a changelog in SQL format?

what I mean is, that inside the changelog file, if there is any way to use it. Im already familiar with the “tag” command in the cli. But, the question is more oriented to if there is a way to accomplish the same result from the changelog itself.

PD: after reading a while, I saw that several users are taking a workaround and updating manully the DATABASECHANGELOG table. I don’t think that this is the correct way to do this.

So, any advice will be appreciated. thanks a lot to the community for your support.

Best regards to all

I already try with:

–changeset alex:2 endDelimiter:@ rollbackEndDelimiter:@ tag:version_1.4
–changeset alex:2 endDelimiter:@ rollbackEndDelimiter:@ tagDatabase: tag:version_1.4
–changeset alex:2 endDelimiter:@ rollbackEndDelimiter:@ tag:“version_1.4”
–changeset alex:2 endDelimiter:@ rollbackEndDelimiter:@ tagDatabase: tag:“version_1.4”

–liquibase formatted sql
–tagDatabase: tag:“version_1.4”

–liquibase formatted sql
–tagDatabase:“version_1.4”

–changeset alex:2 endDelimiter:@ rollbackEndDelimiter:@
–tagDatabase: tag:“version_1.4”

–changeset alex:2 endDelimiter:@ rollbackEndDelimiter:@
–tagDatabase:“version_1.4”

so far… none of these ways works ( the “TAG” field in DATABASECHANGELOG table is not updated with the tag value )

Best regards

1 Like

Has anyone found a solution to this?

The tagDatabase change-type is only available in xml, yaml, and json:

https://docs.liquibase.com/change-types/community/tag-database.html

An alternative is to use the Liquibase “tag” command to tag your database:

https://docs.liquibase.com/commands/community/tag.html