I’m doing some testing prior to implementing Liquibase into our process and I found that tagging works in an unexpected way. I’ve generated a baseline changelog to bootstrap a new DB and have applied it to a new mysql instance, then used the tag command to tag the last applied changeset as “baseline”.
I then wrote a test changelog to test updating from the baseline point onwards; however I got the contexts pattern wrong and no changesets were actually applied (liquibase still ran successfully though). When I tagged the DB following the update, it overwrote the “baseline” tag that had been applied to the last changeset from the baseline DB changelog.
I don’t expect this to be a huge problem as we go forward, but it’s something that I didn’t expect and ideally I’d like to avoid. I did write a script to check if the tag for the last changeset is NULL and only apply a tag if that is the case, but it feels a bit hacky. Is there any way to prevent Liquibase from overwriting the most recent tag if no new changesets have been applied?