tagDatabase outside a changeSet


Is there anyway I can use the tagDatabase tag outside of a changeSet (as if I were running it from the command line).

Currently, in order to tag a database from within the XML, you have to wrap the tagDatabase tag with a changeSet tag. This ends up putting an extra (untagged) changeSet into the db change log. When run from the command line - the tag command doesn’t require this extra changeSet.

Alternatively - could the tagDatabase tag apply to the enclosing changeSet - that would achieve the same goal (although presumably more tricky to implement - as you’d need to wait for the entire changeSet to finish prior to tagging it).

I’m basically trying to come up with a mechanism that allows me to update a site through mutliple versions in one run of liquibase. Currently I have to upgrade in sections - then drop out to tag each between the major versions.

Apparently this got lost in my queue.

You cannot automatically tag the database outside a changeset at this point.  Applying the tag after the chagneset breaks the “run a changeset in a transaction” rule.  Keeping everything inside changeSets makes the rest of the code much easier to deal with.  My theory had been that if you have a changeSet with just a tag, you end up with a new changeset after the tag, but that shouldn’t hurt anything (though not ideal). 

Is there a reason beyond not wanting the extra changeset per tagged version that you need the tag command outside a changeset?


That’s fine. It’s no big deal. Indeed since posting this I’ve learned more about how to use Liquibase for upgrades that it’s not an issue.