Hi,
I’m unable to create Liquibase instance (in my Java code) without providing changelog file. I need it for rollback only, so I think, only database connection should be needed. Is it possible?
Hi,
I’m unable to create Liquibase instance (in my Java code) without providing changelog file. I need it for rollback only, so I think, only database connection should be needed. Is it possible?
Hello. I’m not sure I fully understand the questions, but I’ll provide a couple of tips:
Ok, I was sure, that changelog file is required only for update. I wonder what the changedlog file is required for during the rollback. All the required information are already in the liquibase table, so in my opinion the tag should be sufficient.
The changelog is required for rollback because Liquibase uses the changelog file, in addition to the databasechangelog table, to determine the rollback steps.
Thanks for clarification. I was thinking, that all required data is stored in Liquibase table and only tag is necessary to rollback
While tag is needed to know what state(tag,date,count) to rollback to, the actual rollback depends on metadata table (author,id,path) and what’s written inside the changelog file for rollback.
Example, for XML formatted, liquibase knows the rollback of <createTable> tag, but for SQL formatted, it will run whatever you write after
——rollback
A good way to know is to run rollbackSQL command, which will give you SQL on stdout.
And you will notice —changelogfile is a mandatory parameter for both update and rollback commands. Hope now you understand why.