Need help understanding preconditions and onerror / onfail

I’m trying to get preconditions working so my changelogs will alert me about issues but keep running.

Reading the docs it seems like ‘WARN’ should display a warning and continue running.

“Sends a warning and continues executing the changeset / changelog as normal.”

If I use CONTINUE it runs but shows nothing. If I use WARN it stops (which should be what HALT does) so I’m confused?

My changelog:

databaseChangeLog:
  - changeSet:
      id: 1.2.3.2
      author: yaml-author
      comment: This is a yaml comment
      context: yaml-context
      labels: yaml-label
      preConditions:
        - onFail: WARN
        - onError: WARN
        - not:
            - tableExists:
                - tableName: LB_person
      changes:
        - createTable:
            tableName: LB_person
            columns:
              - column:
                  name: id
                  type: int
                  autoIncrement: true
                  constraints:
                    primaryKey: true
                    nullable: false
              - column:
                  name: firstname
                  type: varchar(50)
              - column:
                  name: lastname
                  type: varchar(50)
                  constraints:
                    nullable: false
              - column:
                  name: state
                  type: char(2)

It does warn me “Reason: changelog-main.yaml : Not precondition failed” but it also seems to throw an exit code which halts everything? Is that expected?

I found this in Liqubase university

Failures and errors will cause Liquibase to return non-zero exit codes.
Warnings will cause Liquibase to return exit code of zero

But now I’m even more confused - how do I handle these sort of issues without failing things?

This chart contains a good description of each option.

If the precondition is checking to see if an object already exists or not, I would typically use MARK_RAN to indicate the changeset is already “complete”. Then the execution will continue without an error.

thanks my issue has been fixed.

thanks my issue has been fixed.