updateSql tag can break rollback operations

Hi,


First of all I’d like to tell you that I’m new to Liquibase forums, but not to Liquibase. I’m using it since the beginning of 2011 and I love it. A really really BIG THANKS to all the people that worked on this tool (and in particular you Nathan), you did a great job !


Don’t you think that all bug reports should begin like this ? :wink:


This said, it seems that updateSql tag can actually break rollback operations …


If you execute the changeset below on a MySQL table mytable that already contains a field1 field, it should work like a charm.


  1.    
  2.         Rollback operation fails on this changeset.
  3.        
  4.            
  5.        
  6.        
  7.            
  8.        
  9.        
  10.            
  11.        
  12.    


But if you try to rollback the changeset, you should obtain an exception due to bad SQL generated by Liquibase : ALTER TABLE mytable DROP COLUMN field2 AFTER field1.


I tried to add the modifySql applyToRollback attribute to the changeset but the generated SQL is the same.


The only solution I found is to use the regExpReplace tag with a specific replace attribute.

  1.        
  2.            
  3.        



Guillaume


PS : sorry, I published this message in the wrong forum. Could you please move it to “Liquibase Users” ?