tags do not have auto-rollback support because liquibase cannot know how to uniquely identify the column to delete.
You can use the tag inside the to specify how to rollback the changeset, however. If you are dropping the whole table in previous rollback and so don’t care if this changeSet is not completely rolled back, you can use an empty rollback tag.
Otherwise, you can specify something like delete from Employee where Code=1 and Name = ‘مشرف’
I tried all these before. You’ve already mentioned this in the documentation. What makes me angry is that I saw other people posting on forums doing the same thing and it works for them.
It seems that Liquibase rolls back the set in spite of the error, but doesn’t continue to rollback the other sets.
Here’s the output of my rollback command:
INFO 27/01/12 07:54 ╒:liquibase: Successfully acquired change log lock INFO 27/01/12 07:54 ╒:liquibase: Reading from [dbo].[DATABASECHANGELOG] INFO 27/01/12 07:54 ╒:liquibase: Rolling Back Changeset:v000/tables/transactions Serial.xml::8::ashraf::(Checksum: 3:8cc76e1659987a39ef7eb7492dfe146d) INFO 27/01/12 07:54 ╒:liquibase: Rolling Back Changeset:v000/tables/employee.xml ::7::ashraf::(Checksum: 3:52f2655840982b712d5289dc9c1fb3a9) INFO 27/01/12 07:54 ╒:liquibase: Rolling Back Changeset:v000/tables/employee.xml ::6::ashraf::(Checksum: 3:0ee689ab8df7ec31359cdcc512f0c941) INFO 27/01/12 07:54 ╒:liquibase: Rolling Back Changeset:v000/tables/group.xml::5 ::ashraf::(Checksum: 3:49b355bdd7428a53d0d38964e94ee52b) INFO 27/01/12 07:54 ╒:liquibase: Successfully released change log lock Liquibase Update Failed: No inverse to liquibase.change.core.InsertDataChange cr eated SEVERE 27/01/12 07:54 ╒:liquibase: No inverse to liquibase.change.core.InsertDat aChange created liquibase.exception.RollbackFailedException: liquibase.exception.RollbackImpossi bleException: No inverse to liquibase.change.core.InsertDataChange created at liquibase.changelog.ChangeSet.rollback(ChangeSet.java:401) at liquibase.changelog.visitor.RollbackVisitor.visit(RollbackVisitor.jav a:23) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58) at liquibase.Liquibase.rollback(Liquibase.java:250) at liquibase.integration.commandline.Main.doMigration(Main.java:805) at liquibase.integration.commandline.Main.main(Main.java:133) Caused by: liquibase.exception.RollbackImpossibleException: No inverse to liquib ase.change.core.InsertDataChange created at liquibase.change.AbstractChange.generateRollbackStatementsFromInverse (AbstractChange.java:145) at liquibase.change.AbstractChange.generateRollbackStatements(AbstractCh ange.java:115) at liquibase.database.AbstractDatabase.executeRollbackStatements(Abstrac tDatabase.java:1090) at liquibase.changelog.ChangeSet.rollback(ChangeSet.java:388) … 5 more
For more information, use the --logLevel flag) Press any key to continue . . .
After this, if run update.bat I get the following output:
INFO 27/01/12 07:55 ╒:liquibase: Successfully acquired change log lock INFO 27/01/12 07:55 ╒:liquibase: Reading from [dbo].[DATABASECHANGELOG] INFO 27/01/12 07:55 ╒:liquibase: Reading from [dbo].[DATABASECHANGELOG] INFO 27/01/12 07:55 ╒:liquibase: ChangeSet v000/tables/employee.xml::6::ashraf r an successfully in 47ms INFO 27/01/12 07:55 ╒:liquibase: ChangeSet v000/tables/employee.xml::7::ashraf r an successfully in 62ms INFO 27/01/12 07:55 ╒:liquibase: ChangeSet v000/tables/transactionsSerial.xml::8 ::ashraf ran successfully in 78ms INFO 27/01/12 07:55 ╒:liquibase: Successfully released change log lock Liquibase Update Successful Press any key to continue . . .
It executes set 6 and 7, which means that they were rolled back in the previous action.
I attach my whole project so you can examine it.
Yes, I use version 2.0.3
Last note: Everything was working very well before adding the insert refactoring
I’ve tried all these before I came here. And all were in vain.
My setup is imitating your tutorial using Oracle on your website. I have an update.xml and a v000 folder, inside it a master.xml file as follows:
Liquibase Update Failed: No inverse to liquibase.change.core.InsertDataChange cr eated SEVERE 26/01/12 08:06 ع:liquibase: No inverse to liquibase.change.core.InsertDat aChange created liquibase.exception.RollbackFailedException: liquibase.exception.RollbackImpossi bleException: No inverse to liquibase.change.core.InsertDataChange created at liquibase.changelog.ChangeSet.rollback(ChangeSet.java:401) at liquibase.changelog.visitor.RollbackVisitor.visit(RollbackVisitor.jav a:23) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58) at liquibase.Liquibase.rollback(Liquibase.java:250) at liquibase.integration.commandline.Main.doMigration(Main.java:805) at liquibase.integration.commandline.Main.main(Main.java:133) Caused by: liquibase.exception.RollbackImpossibleException: No inverse to liquib ase.change.core.InsertDataChange created at liquibase.change.AbstractChange.generateRollbackStatementsFromInverse (AbstractChange.java:145) at liquibase.change.AbstractChange.generateRollbackStatements(AbstractCh ange.java:115) at liquibase.database.AbstractDatabase.executeRollbackStatements(Abstrac tDatabase.java:1090) at liquibase.changelog.ChangeSet.rollback(ChangeSet.java:388) … 5 more
It turned out that it’s my fault. The error (as it’s obvious in the error message) is at the group.xml file which has an insert operation without a roll back.
Sorry for the disturbance and thanks for your help.
I looked at J# a bit, but wasn’t sure on the long-term viability of J# or how much conversion would be required for standard java libraries like JDBC.
I haven’t seen Sharpen before, it may be worth looking into, but it would be nice to keep a consistent codebase between the two if possible. It is enough to manage one codebase, adding a second independent one would make it even harder to keep up Definitely an option, though. I’m working through some structural refactorings for the next liquibase version. After that is done, I may look into the .net port again. It is lower priority for me at the moment, however. Anyone else is more than welcome to take it and run, however.