strict

strict is a global Boolean attribute that specifies whether Liquibase enforces certain best practices and proactively looks for common errors. The default value is false.

Uses

If you set strict to true, Liquibase requires the following:

  • In all changesets, the author field must be non-empty
  • Properties in the defaults file (liquibase.properties) must be valid
  • LIQUIBASE_* environment variable names must be valid

It is a best practice to set strict to true so that your changeset metadata is more useful and you can more easily tell if your properties and environment variables have problems. This lets you catch mistakes before you deploy your changes.

If you leave strict at its default setting of false, Liquibase ignores these requirements.

Syntax

You can set this parameter in the following ways:

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

JVM system property (JAVA_OPTS Environment Variable)

JAVA_OPTS=-Dliquibase.strict=<true|false>
Liquibase Environment Variables
LIQUIBASE_STRICT=<true|false>

For more information, see Working with Command Parameters.

Output

Empty changeset author:

Unexpected error running Liquibase: Validation Failed:
    1 changes have validation failures
        ChangeSet Author is empty, example-changelog.xml::1::

Invalid property in the liquibase.properties file:

Error parsing command line: Strict check failed due to undefined key(s) for 'status' command in file exists at path liquibase.properties':
- 'invalid_property_name'
To define keys that could apply to any command, prefix it with 'liquibase.command.'
To disable strict checking, remove 'strict' from the file.

Invalid environment variable:

WARNING:

Liquibase detected the following invalid LIQUIBASE_* environment variables:

- LIQUIBASE_MADE_UP_VARIABLE

Please rename them and run your command again, or set liquibase.strict=FALSE or LIQUIBASE_STRICT=FALSE.
Find the list of valid environment variables at https://docs.liquibase.com/environment-variables

Error parsing command line: Liquibase detected the following invalid LIQUIBASE_* environment variables:

- LIQUIBASE_MADE_UP_VARIABLE

Please rename them and run your command again, or set liquibase.strict=FALSE or LIQUIBASE_STRICT=FALSE.
Find the list of valid environment variables at https://docs.liquibase.com/environment-variables

Related links