0

I need to tag a changeset for rollback.

Tried this

Way 1

docker run --rm -v $(pwd):/liquibase/ -e "LIQUIBASE_URL=jdbc:postgresql://host/dbname" -e "LIQUIBASE_USERNAME=username" -e "LIQUIBASE_PASSWORD=pass" webdevops/liquibase:postgres tag -Dliquibase.tag='version0.1'

or

docker run --rm -v $(pwd):/liquibase/ -e "LIQUIBASE_URL=jdbc:postgresql://host/dbname" -e "LIQUIBASE_USERNAME=username" -e "LIQUIBASE_PASSWORD=pass" webdevops/liquibase:postgres tag 'version0.1'

on running this i get

/entrypoint: line 172: exec: tag: not found

Way 2

<changeSet  id="3"  author="nvoxland">
        <tagDatabase  tag="version_1.3"/>    
            <addLookupTable  
                existingTableName="person"  existingColumnName="state"  
                newTableName="state"  newColumnName="id"  newColumnDataType="char(2)"/>  
    </changeSet>  

Or

    <changeSet  id="3"  author="nvoxland">
        <tagDatabase  tag="version_1.3"/>    
        <addLookupTable  
            existingTableName="person"  existingColumnName="state"  
            newTableName="state"  newColumnName="id"  newColumnDataType="char(2)"/>  
    </changeSet>  

Error

Invalid content was found starting with element 'addLookupTable'.

How do i tag and rollback?

1 Answers1

0

Can you separate out the tagDatabase as it's own changeset? Something like


    <changeSet  id="3"  author="mo">
        <tagDatabase  tag="version_1.3"/>
    </changeSet> 

Mike Olivas
  • 313
  • 2
  • 8
  • I had tried that. But it just tagged the changeset this tagDatabase is in. Rest all changesets above or below than that didn't got that tag – Hanisha Arora May 29 '20 at 18:04
  • The tag will put a marker in the changelog table. If you want to do something for each changeset, you could add a label, label="version_1.3" to each and every changeset with regards to version 1.3 The tag marker will allow you to rollback to that point. The labels are just informational markers for you to know what is a part of version 1.3. – Mike Olivas Jun 01 '20 at 12:53