Maven checks.show
To maintain or improve the quality of your database changes, get started with policy checks with these articles: Policy Checks and Library of Policy Checks. Maven supports the checks.show
and checks.run
goals. If you need to customize policy checks, use the Liquibase CLI, which supports interactive mode for copy
, customize
, delete
, disable
, enable
, reset
, and bulk-set
. See Policy Checks.
Description
The checks.show
goal prints the available checks and their configurations as indicated in the checks settings file to STDOUT
. See Use the Checks Settings Configuration File.
Uses
Use the checks.show
goal to see the list of all available checks with their settings and decide which checks to run.
Maven configuration
You can configure Liquibase Maven in multiple ways. You can pass arguments like <changeLogFile>
in Maven directly in your pom.xml
file, in a liquibase.properties
file referenced in your POM, as environment variables, or as JVM system properties.
Tip: For more information about the Maven configuration, see Configuring Maven.
Checks settings file configuration
When you start using the policy checks functionality by running any checks goal, Liquibase identifies the need for a checks settings file:
- To create the default checks settings file named
liquibase.checks-settings.conf
in the Liquibase working directory, enter Y at runtime. - To use the in-memory file while running
checks.run
orchecks.show
, enter N at runtime. Other commands require a checks settings file to save the changes for checks. - To use a checks settings file customized for a specific environment or project, pass it with the checks settings file parameter. If you do not include the parameter, Liquibase uses the in-memory file or default settings file –
liquibase.checks-settings.conf
.
Running the checks.show Maven goal
Running the checks.show
goal requires you to have a Maven project implemented.
To run the goal, enter the following at your command prompt:
mvn liquibase:checks.show
When successful, the checks.show
Maven goal produces the following output:
Generating report on current configuration of checks using settings in: liquibase.checks-settings.conf
[INFO] Check settings configuration file located at '/liquibase-maven/liquibase.checks-settings.conf'.
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| # | Check Name | Short Name | Description | Enabled | Customization | Severity |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 10 | Warn on Detection of 'GRANT' | SqlGrantWarn | This check warns a user when | true | <None> | 0 |
| | Statements | | SQL contains 'GRANT' | | | |
| | | | statements so that they can | | | |
| | | | ensure that the privilege | | | |
| | | | being granted won't lead to | | | |
| | | | security issues. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 20 | Warn on Detection of 'REVOKE' | SqlRevokeWarn | This check warns a user when | true | <None> | 0 |
| | Statements | | SQL contains 'REVOKE' | | | |
| | | | statements so that they can | | | |
| | | | ensure that the privilege | | | |
| | | | being revoked won't lead to | | | |
| | | | data access and dependency | | | |
| | | | issues. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 30 | Warn when 'DROP TABLE' | ChangeDropTableWarn | This check warns a user when a | true | <None> | 0 |
| | detected | | table is being dropped so that | | | |
| | | | they can ensure that dropping | | | |
| | | | the table won't lead to | | | |
| | | | unintentional loss of data. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 40 | Warn when 'DROP COLUMN' | ChangeDropColumnWarn | This check warns a user when a | true | <None> | 0 |
| | detected | | column is being dropped so | | | |
| | | | that they can ensure that | | | |
| | | | dropping the column won't lead | | | |
| | | | to unintentional loss of data. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 50 | Warn when 'MODIFY <column>' | ModifyDataTypeWarn | This check warns a user when a | true | <None> | 0 |
| | detected | | change will result in | | | |
| | | | modification of a data type so | | | |
| | | | they can ensure that modifying | | | |
| | | | the data type won't lead to | | | |
| | | | unintentional loss of data | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 60 | Check for specific patterns in | SqlUserDefinedPatternCheck | This check scans raw SQL for | false | SEARCH_STRING = null | 0 |
| | sql | | the presence of specific | | MESSAGE = A match for regular | |
| | | | patterns and warns the user | | expression <SEARCH_STRING> was | |
| | | | when they are found. | | detected in Changeset | |
| | | | | | <CHANGESET>. | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 70 | Check Table Column Count | TableColumnLimit | Ensures that no table has more | true | MAX_COLUMNS = 50 | 0 |
| | | | than a threshold number of | | | |
| | | | columns. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 80 | Object name pattern match | ObjectNameMustMatch | This check confirms the listed | false | OPERATOR = STARTS_WITH | 0 |
| | | | object names conform to the | | SEARCH_STRING = null | |
| | | | supplied pattern. | | OBJECT_TYPES = null | |
| | | | | | CASE_SENSITIVE = true | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 85 | Object name pattern not match | ObjectNameMustNotMatch | This check confirms the listed | false | OPERATOR = STARTS_WITH | 0 |
| | | | object names do not match the | | SEARCH_STRING = null | |
| | | | supplied pattern. | | OBJECT_TYPES = null | |
| | | | | | CASE_SENSITIVE = true | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 90 | Warn on Grant of Specific | SqlGrantSpecificPrivsWarn | This check warns a user when | false | PRIVILEGE_LIST = null | 0 |
| | Privileges | | changeset includes or | | | |
| | | | generates sql that grants | | | |
| | | | specific privileges to a user | | | |
| | | | or role | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 100 | Warn when 'TRUNCATE TABLE' | ChangeTruncateTableWarn | This check warns a user when a | true | <None> | 0 |
| | detected | | table is being truncated so | | | |
| | | | that they can ensure that | | | |
| | | | truncating the table won't | | | |
| | | | lead to unintentional loss of | | | |
| | | | data. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 110 | Warn on Detection of grant | SqlGrantOptionWarn | This check warns a user when | true | <None> | 0 |
| | that contains 'WITH GRANT | | SQL contains 'GRANT' | | | |
| | OPTION' | | statements that include the | | | |
| | | | 'WITH GRANT OPTION' clause so | | | |
| | | | that they can ensure that the | | | |
| | | | privilege being granted won't | | | |
| | | | lead to security issues | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 130 | Warn on Detection of grant | SqlGrantAdminWarn | This check warns a user when | true | <None> | 0 |
| | that contains 'WITH ADMIN | | SQL contains 'GRANT' | | | |
| | OPTION' | | statements that include the | | | |
| | | | 'WITH ADMIN OPTION' clause so | | | |
| | | | that they can ensure that the | | | |
| | | | privilege being granted won't | | | |
| | | | lead to security issues | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 160 | Rollback Required for | RollbackRequired | This check triggers when a | true | <None> | 0 |
| | Changeset | | changeset does not have a | | | |
| | | | rollback defined. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 170 | Changesets Must Have a Label | ChangesetLabelCheck | This check enforces the | true | <None> | 0 |
| | Assigned | | Liquibase recommendation that | | | |
| | | | labels be assigned to each | | | |
| | | | changeset to provide better | | | |
| | | | deployment control and to | | | |
| | | | enhance traceability of | | | |
| | | | efforts across changesets. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 173 | Changesets Must Have a Context | ChangesetContextCheck | This check enforces the | true | <None> | 0 |
| | Assigned | | Liquibase recommendation that | | | |
| | | | contexts be assigned to each | | | |
| | | | changeset to provide better | | | |
| | | | deployment control and to | | | |
| | | | enhance traceability of | | | |
| | | | efforts across changesets. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 176 | Changesets Must Have a Comment | ChangesetCommentCheck | This check enforces the | true | <None> | 0 |
| | Assigned | | Liquibase recommendation that | | | |
| | | | comments be added to each | | | |
| | | | changeset to document the | | | |
| | | | purpose of a changeset for | | | |
| | | | other/future consumers of this | | | |
| | | | changelog | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.752 s
[INFO] Finished at: 2022-03-02T09:29:02-06:00
[INFO] ------------------------------------------------------------------------
checks.show Maven configuration properties
Property | Definition |
---|---|
CLI:
Property in the Environment variable:
|
This is the parameter that specifies the needed checks settings file to work with goals. Set the For more information, see Use the Checks Settings Configuration File. |