dbclhistory-severity

--dbclhistory-severity is a global parameter that lets you specify the exit code for Liquibase to return if an exception is encountered while recording events to the DATABASECHANGELOGHISTORY table. Valid values are INFO (0), MINOR (1), MAJOR (2), CRITICAL (3), and BLOCKER (4), from least severe to most severe. It is available in Liquibase 4.27.0 and later. The default value is 1.

Uses

Liquibase records all database operations to the DATABASECHANGELOGHISTORY (DBCLH) table. If it experiences an error while writing to the DBCLH, it returns an exit code (severity code) that specifies how other programs should respond to the failure. By default, Liquibase returns an exit code of 1 when writing to the DBCLH fails, signifying a minor failure. However, you may want to return a lower or higher exit code when a DBCLH operation halts.

For example, if your deployment pipeline is configured to behave differently if it encounters an exit code of 2 (major failure) but not 1, and the DBCLH is essential to your pipeline, you can set --dbclhistory-severity to 2 to treat DBCLH failures as major.

In contrast, if your pipeline is configured to continue working if it encounters an exit code of 0 and simply produce a message for the operator, and you want to ignore the DBCLH, you can set --dbclhistory-severity to 0 to treat DBCLH failures as information only.

Syntax

You can set this parameter in the following ways:

Option Syntax
Liquibase properties file
liquibase.dbclhistory.severity: <string>
Global flow file argument (example)
stages:
  Default:
    actions:
      - type: liquibase
        command: update
        globalArgs: { dbclhistory-severity: "<string>" }
Global CLI parameter
liquibase
 --dbclhistory-severity=<string> update
 --changelog-file=example-changelog.xml

JVM system property (JAVA_OPTS Environment Variable)

JAVA_OPTS=-Dliquibase.dbclhistory.severity=<string>
Liquibase Environment Variables
LIQUIBASE_DBCLHISTORY_SEVERITY=<string>

For more information, see Working with Command Parameters.

Related links