TableColumnLimit

The TableColumnLimit check allows you to ensure that no table described in a changelog or existing in a database target has more than a threshold number of columns.

Note: Checks require specific parameters noted in the table. Customizations to checks configuration are stored in the liquibase.checks-settings file.

Uses

Use the check to validate that the target tables do not contain more than the allowed number of columns. This gives users more control over the table column count which can be between 1 and 50.

Note: It is important to note that Quality Checks for Databases are only compatible with Relational databases verified as Advanced. Learn more about Database Verification Levels here: Database Verification and Support

Run the TableColumnLimit check

To run the TableColumnLimit check, ensure you have a Liquibase Pro license key, a valid URL property, a URL property that points to a live JDBC connection or a snapshot, and the checks-scope property includes database. The checks-scope parameter is set in the default properties file, environment variable, or any standard method. Then, check the table for column limits. Enable the TableColumnLimit check by running the following command in the CLI:

liquibase checks enable --check-name=TableColumnLimit

Liquibase then prompts you to establish a copy of this check and to initiate the customization work flow. To do this, select options for each of the attributes below in the CLI.

Note: This check can not be enabled directly because one or more fields does not have a default value. Creating a copy of this check initiates the customization work flow.

TableColumnLimit configurable attributes

The following table identifies attributes that are configurable by TableColumnLimit.

Attribute Name Type Description Customization Default Value
SEVERITY String/enum

Set the severity to return a code of 0–4 when the check is triggered.

  • 'INFO' | 0
  • 'MINOR' | 1
  • 'MAJOR' | 2
  • 'CRITICAL' | 3
  • 'BLOCKER' | 4

'INFO' | 0

MAX_COLUMNS Integer Number of columns a tale may contain. -- 50