New Liquibase Labs Quality Checks Commands

The new Quality Checks for databases and the checks-scope parameter are only available with a Liquibase Labs 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:

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. 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 ObjectNameMustMatch check confirms the listed object names conform to the supplied pattern
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: