How to use tagDatabase properly

Hey Guys,

I am new to liquibase and trying to use the tag database feature but having trouble. Basically i am starting midway through a project and it seems to be working ok. I have generated the changelog and done the changelogSyncSQL to identify the queries that will be run on the boxes to setup. However at this point i would like to tag the db with the release version of the app at it starting state in this example which is 0.5.3. So where I am at now is that i have tried to add the tagDatabase to the existing changesets and rerun the syncSQL. However it fails in this case with :

    Migration Failed: cvc-complex-type.2.4.a: Invalid content was found starting with element 'createSequence'. One of '{"":modifySql}' is expected.

    For this changeset:


So as an alternative i just tried creting a new changeset for the tag with :


In this case it does not tag the database but just creates a new changes set called tagging database :

    INSERT INTO DATABASECHANGELOG (DATEEXECUTED, AUTHOR, LIQUIBASE, DESCRIPTION, COMMENTS, MD5SUM, ID, FILENAME) VALUES (SYSDATE, 'me (generated)', '1.9.5', 'Tag Database', '', 'b818a9dd1aa95b53f7e433a4445ad0', '1291354233716-24', './grails-app/migrations/changelog.xml');

And does not actually apply a tag to the database. So at this stage I am a bit stumped as to the problem. Am i misunderstanding the use of the tag in this case? Do i have to run the tag apply directly to the database including prod “i would not be allowed to do this by the dba’s”? I really have no idea and the doco just says <tagDatabase=“blah”/> which is not particularly helpful :wink: .

Any help would be appreciated because I would really like to get this setup properly the first time and not have to hack it later. It might also be a good business case for us to use it if i get a good process setup.

Cheers Dave

(sorry for the slow reply)

Are you trying to run the tag changeSet with syncSQL?  It won’t actully tag it unless you run “update”.  Otherwise, changeLogSync is just to mark changeSets as ran without actually running htem.

There is also a tag command you can use from the command line as well.  So you could run liquibase tag version_0.5.3