supports-method-validation-level

--supports-method-validation-level is a global parameter. You can use it to control the level of validation to check if a change's supports() method is properly implemented. It is available in Liquibase 4.29.0 and later. Valid values are OFF, WARN, and FAIL. The default value is WARN.

Uses

--supports-method-validation-level is relevant to users who are writing Liquibase extensions that add or maintain support for database changes. For more information, see Contribute: Extensions Overview.

When you run any Liquibase command, Liquibase loads all Java Change Type classes (such as CreateIndexChange.java) from extensions you have installed.

Then, Liquibase checks if these change classes correctly implement a supports() method. If your implementation is correct, Liquibase proceeds with the operation: it runs the supports() method to check whether this Change Type is compatible with the database you're trying to deploy it to.

However, if your implementation is incorrect, Liquibase behaves according to the value of --supports-method-validation-level:

  • If you set --supports-method-validation-level to OFF, Liquibase proceeds with the operation and displays no output messages.
  • If you set --supports-method-validation-level to WARN (default), Liquibase proceeds with the operation and displays the following output message:
  • BrokenClassExample class does not implement the 'supports(Database)' method and may incorrectly override other databases changes causing unexpected behavior. Please report this to the Liquibase developers or if you are developing this change please fix it ;)
  • If you set --supports-method-validation-level to FAIL, Liquibase halts the operation and displays the same output message as it does for WARN.

Syntax

You can set this parameter in the following ways:

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

JVM system property (JAVA_OPTS Environment Variable)

JAVA_OPTS=-Dliquibase.supportsMethodValidationLevel=<string>
Liquibase Environment Variables
LIQUIBASE_SUPPORTS_METHOD_VALIDATION_LEVEL=<string>

For more information, see Working with Command Parameters.