Dockerfile icon indicating copy to clipboard operation
Dockerfile copied to clipboard

How to use Tag command for rollback?

Open hanishaarora opened this issue 5 years ago • 1 comments

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?

hanishaarora avatar May 18 '20 18:05 hanishaarora

Add the tagDatabase as a separate entity:

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

Constantin07 avatar Mar 20 '21 07:03 Constantin07