Add rollback tags to liquibase diff

Hi All,
Is there anyway to generate rollback tags to a diffChangelog xml file?

Basically I want to keep a QA Db “insync” with a Dev db.

I want to
1.) Generate the diffs between a machine used for Dev and QA to see which DB changes still needs to be applied in QA.
2.) Generate update sql from the diff file.
3.) Generate rollback sql from the diff file
4.) Use generateChangelog to get the data from base Db and then eyeball what really needs to be taken over to QA.

I’ve gotten 1 & 2 finished and 4 I’ve worked with before, but it seems I would need to manually add rollback tags to xml for 3 to work going off what the stacktrace says.

My setup is as follows:
liquibase.properties:
changeLogFile=changelog.xml
driver=oracle.jdbc.OracleDriver
url=jdbc:oracle:thin:@{target_server}:{port}:{schema}
username=kuldev
password=*
referenceUrl=jdbc:oracle:thin:@{base_server}:{port}:{schema}
referenceUsername=kuldev
referencePassword=


  1.  C:\Dev\liquibase-3.0.7-bin>liquibase diffChangeLog
  2. C:\Dev\liquibase-3.0.7-bin>liquibase updateSQL > update.sql
  3.  C:\Dev\liquibase-3.0.7-bin>liquibase futureRollbackSQL > rollback.sql
Running above in debug mode I get:


Liquibase futureRollbackSQL Failed: liquibase.exception.RollbackImpossibleException: No inverse to liquibase.change.core.ModifyDataTypeChange created
SEVERE 6/18/14 3:53 PM:liquibase: changelog.xml::1403085941005-81::Adrian (generated): liquibase.exception.RollbackImpossibleException: No inverse to liquibase.change.core.ModifyDataTypeChange created
liquibase.exception.RollbackFailedException: liquibase.exception.RollbackImpossibleException: No inverse to liquibase.change.core.ModifyDataTypeChange created
        at liquibase.changelog.ChangeSet.rollback(ChangeSet.java:429)
        at liquibase.changelog.visitor.RollbackVisitor.visit(RollbackVisitor.java:32)
        at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:64)
        at liquibase.Liquibase.futureRollbackSQL(Liquibase.java:531)
        at liquibase.Liquibase.futureRollbackSQL(Liquibase.java:483)
        at liquibase.integration.commandline.Main.doMigration(Main.java:909)
        at liquibase.integration.commandline.Main.main(Main.java:133)
Caused by: liquibase.exception.RollbackImpossibleException: No inverse to liquibase.change.core.ModifyDataTypeChange created
        at liquibase.change.AbstractChange.generateRollbackStatementsFromInverse(AbstractChange.java:400)
        at liquibase.change.AbstractChange.generateRollbackStatements(AbstractChange.java:373)
        at liquibase.database.AbstractJdbcDatabase.executeRollbackStatements(AbstractJdbcDatabase.java:1530)
        at liquibase.changelog.ChangeSet.rollback(ChangeSet.java:417)
        … 6 more


If anyone has gone through a similar exercise I would be interested in the strategies you followed.
Any suggestions welcomed.

Regards
Adrian

Yes, you are correct - either you or (ideally) the person who initially created the change would need to write the rollback steps for anything that can’t be automatically rolled back. 

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/