0
votes

I am new to Liquibase and I am trying to get the rollback feature working. I am running Liquibase in Windows. I executed an install which tagged the database at version_1.0. I ran an update which tagged the database at version_1.1. Now I am trying to rollback to version_1.0

Here is the command I am running:

liquibase rollback version_1.0

this gives an error that a --changeLogFile is needed so I ran this

liquibase --changeLogFile=v001/master.xml rollback version_1.0

I provide the name of the change log file that was executed during the update, but nothing gets. The update contains 2 create table statements and the tables were not dropped. What am I missing in the rollback process?

1
If you can show the contents of your changelog, the contents of the DATABASECHANGELOG table, and any output from the command, that would help.SteveDonie
I was calling the incorrect changeLogFile. I was able to see the changes that would be rolled back and debug the issue using the rollbackSQL commandweevil
Why do I need to provide the name of that changeLogFile at all? Shouldn't it know all of the changes implemented since version_1.0 and the changeLogFiles associated from the DATABASECHANGELOG table?weevil
When the change log file name is saved to the DATABASECHANGELOG table, it is being used as a unique identifier rather than a path to an actual file. Typically it is a relative path from the root of some 'project' you are working on. When Liquibase runs on a specific machine, it needs to locate an actual file, so that is what you are providing on the command line.SteveDonie

1 Answers

0
votes

Liquibase does not tag the database really. It only tags to know which changessets need to be rolled back.

The rollback will be done by execute the rollback tags in the changeling.