Looks like I found an answer to my 1st question “Are empty rollback statements not allowed in “SQL formatted output””
“–rollback not required” is what I need. See the following discussion for more about how this came about
http://forum.liquibase.org/#topic/49382000000028385
Can this be added to the official Liquibase documentation?
I am facing an issue with using the “rollback” feature in a “formatted SQL output” file.
My SQL file consists of the following changesets:
- CS1 = Create table with a rollback to drop table
- CS2 = Create index on column in table created by CS1 with an empty rollback
- CS3 = Alter table created by CS1 with an empty rollback
- CS3 = Insert data into table created by CS1 with an empty rollback
I was able to update the DB successfully to apply the above changesets. However when I attempt to roll-back I encounter the following error for CS4’s rollback:
“Unexpected error running Liquibase: No inverse to liquibase.change.core.RawSQLChange created”
Assuming the above error was due to the empty rollback (which I expected should have worked in the first place), I modified the rollback for CS4 to delete the row I inserted, but then encountered an error that “liquibase: Validation Failed” due to the differing check sum (although I read another post from 4 years ago that stated that rollback statements are not part of the check sum calculation.
Questions:
- Are empty rollback statements not allowed in "SQL formatted output"
- Are rollback statements now part of the check sum calculation?