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.

About TableColumnLimit
Liquibase version required 4.5.0+
Scope (--checks-scope) changelog, database
Default status enabled
Default severity (exit code) 0 ("INFO")
Customizable settings Yes (dynamic)

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.

Use TableColumnLimit

Prerequisites

  1. Ensure that you have correctly specified your Liquibase Pro license key.
  2. Ensure that the --checks-scope parameter includes the scope of this check.

For example:

--license-key=<string>
--checks-scope=<string>
globalArgs: { license-key: "<string>" }
cmdArgs: { checks-scope: "<string>" }
liquibase.licenseKey: <string>
liquibase.command.checksScope: <string>
liquibase.licenseKey: <string>
liquibase.command.checks.run.checksScope: <string>
JAVA_OPTS=-Dliquibase.licenseKey=<string> -Dliquibase.command.checksScope=<string>
JAVA_OPTS=-Dliquibase.licenseKey=<string> -Dliquibase.command.checks.run.checksScope=<string>
LIQUIBASE_LICENSE_KEY=<string>
LIQUIBASE_COMMAND_CHECKS_SCOPE=<string>
LIQUIBASE_LICENSE_KEY=<string>
LIQUIBASE_COMMAND_CHECKS_RUN_CHECKS_SCOPE=<string>

Enable

This check is enabled by default. To verify that it is currently enabled, run the show command:

liquibase checks show --check-name=<string>

Customize

This check is dynamic, meaning you can customize its settings. See the table on this page for more information.

  1. If you want to customize any default values of this check, run the customize command:
  2. liquibase checks customize --check-name=<string>
  3. When finished, verify that your configuration is correct by running the show command:
  4. liquibase checks show --check-name=<string>

Run

To run the check, use the run command:

liquibase checks run --check-name=<string>
stages:
  Default:
    actions:
      - type: liquibase
        command: checks run
        cmdArgs: {check-name: <string>}

And then run the flow command on your flow file:

liquibase flow

Customization settings

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. Default: 0.

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

'INFO' | 0

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