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
- 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 theliquibase checks show
command to display the short name. - 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 theDROP TABLE
check, which isChangeDropTableWarn
. -
Then, disable the check with the
--check-name
parameter that includes the short name found in step 2:liquibase checks disable --check-name=ChangeDropTableWarn
- Execute the
liquibase checks run
command to ensure theChangeDropTableWarn
check is disabled successfully. If it is disabled, no issues will be detected as shown in the output below.CopySuccessful 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.
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.
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.
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
- use the enable command.