New Liquibase Lab Quality Checks Commands
The new Quality Checks for databases and the checks-scope
parameter are only available with a Liquibase Lab license. These checks allow you to confirm the presence of specific objects and conditions in the database to ensure the integrity of the database. To execute the new quality checks and improve the quality of your database changes, use the quality checks
for databases listed below. To learn how to apply your checks to a specific scope, see the checks-scope
parameter. For more information about using quality checks, see Working with Quality Checks .
The new database checks are:
- ConstraintMustExist
- TableCommentCheck
- TableCommentPatternCheck
- TableColumnLimit
- ObjectNameMustMatch
- ObjectNameMustNotMatch
checks
command
The liquibase checks
command is a command group that lets you show, customize, and run quality checks. For more information, see Get Started with the checks Command . Many checks can (or must) be customized and the table below lists the different customization options.
You can optionally enable the --verbose
command while using the checks run
command to expand the output to display a deeper level of detail about tables or other database objects checked. Outputs are listed below to show the difference between a --verbose
output and a non --verbose
output.
checks
names
ConstraintMustExist
|
Value |
---|---|
Short name | ConstraintMustExist |
Description | The ConstraintMustExist check looks for and alerts you when the specified table does not contain the required Constraint(s). |
Type | Dynamic |
Enabled by default | No |
Scope | Database |
TableCommentPatternCheck
|
Value |
---|---|
Short name | TableCommentPatternCheck |
Description | The TableCommentPatternCheck check triggers when specific user-supplied patterns are found in Table Comments. |
Configurable Attributes |
Attribute Name: ConstraintOperator Type: String / enum Description: The location to look for the provided Search String Value Default Value: contains Options: |
Type | Dynamic |
Enabled by default | No |
Scope | Database |
TableCommentPatternCheck
Configurable Attributes
The following table identifies attributes that are configurable by TableCommentPatternCheck
.
Attribute Name | Type | Description | Options/ Validation | Default Value |
---|---|---|---|---|
Operator
|
String/enum | The location to look for the provided SearchString value |
- startsWith - SearchString provided should be found at the beginning of the table. - endsWith - SearchString provided should be found at the end of the table. - contains - SearchString provided can be anywhere in the lable. - regexp - SearchString provided is a regexp that should be matched. |
contains |
SearchString
|
String/enum | The substring or regular expression to match. | Validation - SearchString should be a valid regular expression. | |
Message
|
String/enum | The message you wish to print when the check detects a pattern match |
none |
A match for regular expression {{SearchString}} value was detected in Changeset changeset id. |
Severity
|
String/enum | Set CASE_SENSITIVE (options: true, false) | user entry of true or false is accepted case-insensitively | false |
Constraint
|
String/enum | Enter the required constraint(s), separate | NOT NULL, UNIQUE, PRIMARYKEY, FOREIGNKEY | PRIMARYKEY |
TableCommentCheck
|
Value |
---|---|
Short name | TableCommentCheck |
Description | The TableCommentCheck database check flags any table which does not have a comment. (Note: This is not a check for a Liquibase changelog comment.) |
Configurable Attributes |
Attribute Name: ConstraintOperator Type: String / enum Description: The location to look for the provided Search String Value Default Value: contains Options: |
Type | Dynamic |
Enabled by default | No |
Scope | Database |
TableColumnLimit
|
Value |
---|---|
Short name | TableColumnLimit |
Description | The TableColumnLimit ensures that no table described in a changelog or existing in a database target has more than a threshold number of columns. |
Configurable Attributes |
Attribute Name: ConstraintOperator Type: String / enum Description: The location to look for the provided Search String Value Default Value: contains Options: |
Type | Dynamic |
Enabled by default | No |
Scope | Changelog, Database |
Object name checks
|
Value |
---|---|
Short name | ObjectNameMustMatch |
Description |
The |
Configurable Attributes |
Attribute Name: ConstraintOperator Type: String / enum Description: The location to look for the provided Search String Value Default Value: contains Options: |
Type | Dynamic |
Enabled by default | No |
Scope | Changelog, Database |
|
Value |
---|---|
Short name | ObjectNameMustNotMatch |
Description | The ObjectNameMustNotMatch check triggers when the object name includes the supplied pattern. It also ensures names do have the supplied string or regex. |
Configurable Attributes |
Attribute Name: ConstraintOperator Type: String / enum Description: The location to look for the provided Search String Value Default Value: contains Options: |
Type | Dynamic |
Enabled by default | No |
Scope | Changelog, Database |
Database Objects Validated Output example:

liquibase checks run --checks-scope=database
Starting Liquibase at 09:54:30 (version [Core: //DAT-9298/2516/e42617/2022-05-11 19:02+0000, Pro: DAT-9298/1208/56ac6a/2022-05-11T18:56:15Z] #2516 built at 2022-05-11 19:02+0000)
Liquibase Version: [Core: //DAT-9298/2516/e42617/2022-05-11 19:02+0000, Pro: DAT-9298/1208/56ac6a/2022-05-11T18:56:15Z]
Liquibase Empire [Core: //DAT-9298/2516/e42617/2022-05-11 19:02+0000, Pro: DAT-9298/1208/56ac6a/2022-05-11T18:56:15Z] by Liquibase licensed to Dev until Sat Dec 30 21:59:59 MST 2023
Executing Quality Checks against database jdbc:h2:tcp://localhost:9090/mem:dev
Executing all database checks because a valid license key was found!
INFO This command might not yet capture Liquibase Pro additional object types on h2 Database objects Validated:
Liquibase command 'checks run' was executed successfully.

liquibase checks run --checks-scope=database --verbose
Database objects Validated:
Catalog : 1
DEV
Column : 55
DEV.PUBLIC.BONUSES.CHEESE
DEV.PUBLIC.BONUSES.ID
DEV.PUBLIC.BONUSES.INCHES
DEV.PUBLIC.BONUSES.RAINBOWS
DEV.PUBLIC.BONUSES.TOPPING
DEV.PUBLIC.CAFE.ADDRESS1
DEV.PUBLIC.CAFE.ADDRESS2
DEV.PUBLIC.CAFE.CITY
DEV.PUBLIC.CAFE.ID
DEV.PUBLIC.CAFE.NAME
DEV.PUBLIC.CAFETABLES.CHEESE
DEV.PUBLIC.CAFETABLES.ID
DEV.PUBLIC.CAFETABLES.INCHES
DEV.PUBLIC.CAFETABLES.RAINBOWS
DEV.PUBLIC.CAFETABLES.TOPPING
DEV.PUBLIC.CUSTOMERS.CHEESE
DEV.PUBLIC.CUSTOMERS.ID
DEV.PUBLIC.CUSTOMERS.INCHES
DEV.PUBLIC.CUSTOMERS.RAINBOWS
DEV.PUBLIC.CUSTOMERS.TOPPING
DEV.PUBLIC.DRINKS.CHEESE
DEV.PUBLIC.DRINKS.ID
DEV.PUBLIC.DRINKS.INCHES
DEV.PUBLIC.DRINKS.RAINBOWS
DEV.PUBLIC.DRINKS.TOPPING
DEV.PUBLIC.FED_TAXES.CHEESE
DEV.PUBLIC.FED_TAXES.ID
DEV.PUBLIC.FED_TAXES.INCHES
DEV.PUBLIC.FED_TAXES.RAINBOWS
DEV.PUBLIC.FED_TAXES.TOPPING
DEV.PUBLIC.FOODS.CHEESE
DEV.PUBLIC.FOODS.ID
DEV.PUBLIC.FOODS.INCHES
DEV.PUBLIC.FOODS.RAINBOWS
DEV.PUBLIC.FOODS.TOPPING
DEV.PUBLIC.STAFFERS.CHEESE
DEV.PUBLIC.STAFFERS.ID
DEV.PUBLIC.STAFFERS.INCHES
DEV.PUBLIC.STAFFERS.RAINBOWS
DEV.PUBLIC.STAFFERS.TOPPING
DEV.PUBLIC.STATE_TAXES.CHEESE
DEV.PUBLIC.STATE_TAXES.ID
DEV.PUBLIC.STATE_TAXES.INCHES
DEV.PUBLIC.STATE_TAXES.RAINBOWS
DEV.PUBLIC.STATE_TAXES.TOPPING
DEV.PUBLIC.STOOLS.ADDRESS1
DEV.PUBLIC.STOOLS.ADDRESS2
DEV.PUBLIC.STOOLS.CITY
DEV.PUBLIC.STOOLS.ID
DEV.PUBLIC.STOOLS.NAME
DEV.PUBLIC.VENDORS.CHEESE
DEV.PUBLIC.VENDORS.ID
DEV.PUBLIC.VENDORS.INCHES
DEV.PUBLIC.VENDORS.RAINBOWS
DEV.PUBLIC.VENDORS.TOPPING
Index : 11
DEV.PUBLIC.BONUSES.PRIMARY_KEY_2
DEV.PUBLIC.CAFE.PRIMARY_KEY_1
DEV.PUBLIC.CAFETABLES.PRIMARY_KEY_D1
DEV.PUBLIC.CUSTOMERS.PRIMARY_KEY_6
DEV.PUBLIC.DRINKS.PRIMARY_KEY_7
DEV.PUBLIC.FED_TAXES.PRIMARY_KEY_3E
DEV.PUBLIC.FOODS.PRIMARY_KEY_3
DEV.PUBLIC.STAFFERS.PRIMARY_KEY_7C
DEV.PUBLIC.STATE_TAXES.PRIMARY_KEY_12
DEV.PUBLIC.STOOLS.PRIMARY_KEY_9
DEV.PUBLIC.VENDORS.PRIMARY_KEY_3F
PrimaryKey : 11
DEV.PUBLIC.BONUSES.CONSTRAINT_2
DEV.PUBLIC.CAFE.CONSTRAINT_1
DEV.PUBLIC.CAFETABLES.CONSTRAINT_D
DEV.PUBLIC.CUSTOMERS.CONSTRAINT_6
DEV.PUBLIC.DRINKS.CONSTRAINT_7
DEV.PUBLIC.FED_TAXES.CONSTRAINT_3E
DEV.PUBLIC.FOODS.CONSTRAINT_3
DEV.PUBLIC.STAFFERS.CONSTRAINT_7C
DEV.PUBLIC.STATE_TAXES.CONSTRAINT_12
DEV.PUBLIC.STOOLS.CONSTRAINT_9
DEV.PUBLIC.VENDORS.CONSTRAINT_3F
Schema : 1
DEV.PUBLIC
Table : 11
DEV.PUBLIC.BONUSES
DEV.PUBLIC.CAFE
DEV.PUBLIC.CAFETABLES
DEV.PUBLIC.CUSTOMERS
DEV.PUBLIC.DRINKS
DEV.PUBLIC.FED_TAXES
DEV.PUBLIC.FOODS
DEV.PUBLIC.STAFFERS
DEV.PUBLIC.STATE_TAXES
DEV.PUBLIC.STOOLS
DEV.PUBLIC.VENDORS
Liquibase command 'checks run' was executed successfully.