Reputation: 331
I have an .xml file with sql procedure with runOnChange = 'true'. And this procedure was updated last to DATACHANGELOG table.
...
<changeSet author="rozmaryn" id="040920201357" runOnChange="true" runInTransaction="true">
<sqlFile path="storedProcedures/procedureFirst.sql"
encoding="UTF-8"
relativeToChangelogFile="true"/>
</changeSet>
But if I rollback for example "rollbackCount=5", I have an error.
I know that I can add <rollback></rollback>
node, but since I have runOnChange I would like to skip rollback of the procedure by command. It is possible?
Upvotes: 1
Views: 442
Reputation: 5
From the doc:
If you do not want to revert a change in a rollback mode, use either the keyword empty or the keyword not required inside the rollback tag. In XML, YAML, and JSON changelogs, you can also use an empty string inside the rollback tag.
<changeSet id="3" author="liquibaseuser">
<createTable tableName="testTable">
<column name="id" type="int"/>
</createTable>
<rollback>empty</rollback>
</changeSet>
https://docs.liquibase.com/commands/rollback/rollback-by-tag.html
Upvotes: 0