Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

liquibase does not add script to history when changeset fails

Tags:

liquibase

When a changeset is marked as failOnError:false, does liquibase record it as having been applied when it fails?

For example, we have a script that performs a pre-emptive drop table in one changeset and then creates the table in the next changeset. When the script is first run, the drop table statement fails as expected and then the table is created successfully. However, the changeset that attempted the drop table is not added to the databasechangelog table.

Is that expected behavior?

like image 531
Frank Calfo Avatar asked Nov 28 '25 06:11

Frank Calfo


1 Answers

That is the current behavior currently. Depending on the reason for the failure, it can make sense to either continue to retry it or to not.

I created https://liquibase.jira.com/browse/CORE-1766 to add the feature to mark it as failed and not try again.

Currently, your best option would be to add a precondition to the dropTable changeSet with onFail="MARK_RAN"

like image 52
Nathan Voxland Avatar answered Nov 29 '25 22:11

Nathan Voxland



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!