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” ?

Hi bro,

I am using below script to add FILE_NUMBER2 column before PORT_ID column(i.e at the begining of the table),but it is not working can you please help me .It is quite urgent.
I tried with first=true attribute that is also not working.

Regards,
Vish

Hi @vishuwillbe

Could you please explain the complete scenario you are trying? Also could you please provide the following details as it could help us to debug the issue you are facing:

  1. Liquibase version you are using

  2. Complete log generated (with log level set to DEBUG)

  3. Your liquibase.properties file

Thanks!
Rakhi Agrawal