Ability to mark failed changesets as failed in databasechangelog
Description
Environment
All
Activity
Show:

Gareth Smith December 16, 2019 at 10:26 AM
It seems that Liquibase (3.8.1
) doesn't record failed changesets, even when failOnError=true
.
This means that Liquibase will retry the failed changesets every time it runs, which can be dangerous if the changesets are not idempotent. E.g. if a changeset does “update some_table set value = value + 1” and then does some DDL that fails (e.g. adding a column that already exists). DDL is not transactional in MySQL, so “value = value + 1” will be run and committed every time Liquibase tries to run the changeset.
It would be nice if Liquibase marked the changeset as failed in the database and required someone to manually mark it is “safe-to-retry” before it tries to re-run it. IIRC this is similar to what Flyway does.
From http://stackoverflow.com/questions/21693135/liquibase-does-not-add-script-to-history-when-changeset-fails
When a changeset is marked as failOnError:false, liquibase does not record it in the databasechangelog table, it just treats it like SKIP.
This makes sense in some cases but not all. Provide a way to be able to mark the changeSet as failed but not retry.