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?