Preconditions: Handling failures and errors


I really appreciate your tool, as I was evaluating it for our application. Geat work.

Now my question which I hope was not asked before (search did not bring up anything):

Is it possible to assign different onFail actions, depending on which of the checks in the preconditions failed?

I want to add a column to a table, but it may happen in our environment, that the whole table does not exist.
If the column (and so the table) already exists the change should be marked RAN. But if the whole table does not exist, CONTINUE, as the table could be added later on.

My first approach was to have an onFail and onError attribute and then run the check

In your example, I’m not sure why you can’t use RAN when the precondition fails regardless of whether it’s because the table doesn’t exist or the column doesn’t exist. Do you run liquibase twice to pick up the column changeSet you wanted to continue past on the second time through?


Yes, exactly. It may happen, that the table will be added later on. Running again, should then add the column.