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.

  • 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.



Run the TableColumnLimit check

To run the TableColumnLimit check, ensure you have a Liquibase Lab license, 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 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.

The check is active.

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 Options/ Validation Default Value
MAX_COLUMNS

INT

Number of columns a tale may contain.

 

50
Severity

STRING

Set the severity to return a code of 0-4 when triggered.

INFO | 0,
MINOR | 1,
MAJOR | 2,
CRITICAL | 3,
BLOCKER | 4

INFO

The Table Column Limit displays in the output within the CLI.