Disable Policy Checks

Disabling a Policy Check may be necessary when you have a check that is designed to detect specific scenarios that do not require constant monitoring for that particular pattern. This is done by using the disable command.

Step-by-step

  1. To disable a check, you need to know the short name, which you can retrieve by running the show command. A short name is often given when Customizing a Policy Check.

    In the CLI, Run the liquibase checks show command to display the short name.
  2. Note: The show subcommand lists information and customization settings for available checks including the check’s full name, short name, description, enabled status, and customization options.

  3. Once the show list appears in the CLI, look for the short name for the check you're looking for.
    In this example we are looking for the DROP TABLE check, which is ChangeDropTableWarn.
  4. Then, disable the check with the --check-name parameter that includes the short name found in step 2:

    liquibase checks disable --check-name=ChangeDropTableWarn
  5. Note: Liquibase retains the configuration change to your checks configuration file, the default of which is liquibase.checks-settings.conf. This means that you don't have to disable this check everytime you utilize Liquibase.

  6. Execute the liquibase checks run command to ensure the ChangeDropTableWarn check is disabled successfully. If it is disabled, no issues will be detected as shown in the output below.
    Copy

    Successful check disable CLI output

    Executing Policy Checks against changelog.sql

    Changesets Validated:
      ID: 1; Author: your.name; File path: changelog.sql
      ID: 2; Author: your.name; File path: changelog.sql
      ID: 3; Author: other.dev; File path: changelog.sql
      ID: 4; Author: other.dev; File path: changelog.sql

    run against each changeset:
      Warn on Detection of 'GRANT' Statements
      Warn on Detection of 'REVOKE' Statements
      Warn when 'DROP COLUMN' detected
      Warn when 'MODIFY <column>' detected
      Check Table Column Count
                    
    Liquibase command 'run' was executed successfully.

With this feature, you can disable a check that is designed to detect specific scenarios that do not require constant monitoring for that particular pattern.

Next Steps