copy

Note: This is a Liquibase Pro feature, so you need a Liquibase Pro License Key to use it.

The copy subcommand copies a customizable check so that you can run the same check multiple times with different command arguments.

Uses

If you want to run the same check with different values, use copy to make a new version with new values. If enabled, both checks will be run in the same execution.

For example, you can make two copies of the check that scans SQL:

  • SQL should not contain COPY DATABASE
  • SQL should not contain ALTER USER

Liquibase does not allow you to copy static checks because they do not include customization options, and having the same check is redundant.

Note: To view a list of available checks, run liquibase checks show.

Syntax

The command is interactive, and you need to follow the CLI output messages to execute it:

  1. Run the command specifying your values:
  2. liquibase checks copy --check-name=TableColumnLimit

    Note: If you have a checks settings file customized for a specific environment or project, you need to pass that using the --checks-settings-file parameter. If you do not include this parameter, Liquibase uses the default settings file: liquibase.checks-settings.conf. See Use the Checks Settings Configuration File.

  3. Enter the name of the check copy using alphanumeric characters. Also, the name of the copy should differ from the original name.

The command adds the copy of a check to the checks settings file. To execute the check, use the run subcommand.

Parameters

Global parameters

Parameter Definition Requirement

--license-key=<string>

Your Liquibase Pro license key

Required

Command parameters

Parameter Description Requirement

--check-name=<string>

The name of the check(s) you want to target. Comma-separated list of one or more enabled checks. Checks to exclude can be prefixed with the ! character. If no checks are specified, all enabled checks are targeted. For example: --check-name=shortname1,shortname2,!shortname3

Required

--auto-enable-new-checks=<true|false>

Automatically enable new quality checks in liquibase.checks.conf file when they are available. Default: false.

Optional

--auto-update=<string>

Allows automatic backup and updating of the liquibase.checks-settings.conf file when new quality checks are available. Valid values are ON and OFF. Default: OFF.

Optional

--checks-settings-file=<string>

Specifies the checks settings file to use with commands. Write the relative path of the settings file that you want to read from or modify. For more information, see Use the Checks Settings Configuration File.

Optional

Global parameters

Parameter Definition Requirement

globalArgs: { license-key: "<string>" }

Your Liquibase Pro license key

Required

Command parameters

Parameter Description Requirement

cmdArgs: { check-name: "<string>" }

The name of the check(s) you want to target. Comma-separated list of one or more enabled checks. Checks to exclude can be prefixed with the ! character. If no checks are specified, all enabled checks are targeted. For example: --check-name=shortname1,shortname2,!shortname3

Required

cmdArgs: { auto-enable-new-checks: "<true|false>" }

Automatically enable new quality checks in liquibase.checks.conf file when they are available. Default: false.

Optional

cmdArgs: { auto-update: "<string>" }

Allows automatic backup and updating of the liquibase.checks-settings.conf file when new quality checks are available. Valid values are ON and OFF. Default: OFF.

Optional

cmdArgs: { checks-settings-file: "<string>" }

Specifies the checks settings file to use with commands. Write the relative path of the settings file that you want to read from or modify. For more information, see Use the Checks Settings Configuration File.

Optional

Global parameters

Parameter Definition Requirement

liquibase.licenseKey: <string>

Your Liquibase Pro license key

Required

Command parameters

Parameter Description Requirement

liquibase.command.checkName: <string>

liquibase.command.checks.copy.checkName: <string>

The name of the check(s) you want to target. Comma-separated list of one or more enabled checks. Checks to exclude can be prefixed with the ! character. If no checks are specified, all enabled checks are targeted. For example: --check-name=shortname1,shortname2,!shortname3

Required

liquibase.command.autoEnableNewChecks: <true|false>

liquibase.command.checks.copy.autoEnableNewChecks: <true|false>

Automatically enable new quality checks in liquibase.checks.conf file when they are available. Default: false.

Optional

liquibase.command.autoUpdate: <string>

liquibase.command.checks.copy.autoUpdate: <string>

Allows automatic backup and updating of the liquibase.checks-settings.conf file when new quality checks are available. Valid values are ON and OFF. Default: OFF.

Optional

liquibase.command.checksSettingsFile: <string>

liquibase.command.checks.copy.checksSettingsFile: <string>

Specifies the checks settings file to use with commands. Write the relative path of the settings file that you want to read from or modify. For more information, see Use the Checks Settings Configuration File.

Optional

Global parameters

Parameter Definition Requirement

JAVA_OPTS=-Dliquibase.licenseKey=<string>

Your Liquibase Pro license key

Required

Command parameters

Parameter Description Requirement

JAVA_OPTS=-Dliquibase.command.checkName=<string>

JAVA_OPTS=-Dliquibase.command.checks.copy.checkName=<string>

The name of the check(s) you want to target. Comma-separated list of one or more enabled checks. Checks to exclude can be prefixed with the ! character. If no checks are specified, all enabled checks are targeted. For example: --check-name=shortname1,shortname2,!shortname3

Required

JAVA_OPTS=-Dliquibase.command.autoEnableNewChecks=<true|false>

JAVA_OPTS=-Dliquibase.command.checks.copy.autoEnableNewChecks=<true|false>

Automatically enable new quality checks in liquibase.checks.conf file when they are available. Default: false.

Optional

JAVA_OPTS=-Dliquibase.command.autoUpdate=<string>

JAVA_OPTS=-Dliquibase.command.checks.copy.autoUpdate=<string>

Allows automatic backup and updating of the liquibase.checks-settings.conf file when new quality checks are available. Valid values are ON and OFF. Default: OFF.

Optional

JAVA_OPTS=-Dliquibase.command.checksSettingsFile=<string>

JAVA_OPTS=-Dliquibase.command.checks.copy.checksSettingsFile=<string>

Specifies the checks settings file to use with commands. Write the relative path of the settings file that you want to read from or modify. For more information, see Use the Checks Settings Configuration File.

Optional

Global parameters

Parameter Definition Requirement

LIQUIBASE_LICENSE_KEY=<string>

Your Liquibase Pro license key

Required

Command parameters

Parameter Description Requirement

LIQUIBASE_COMMAND_CHECK_NAME=<string>

LIQUIBASE_COMMAND_CHECKS_COPY_CHECK_NAME=<string>

The name of the check(s) you want to target. Comma-separated list of one or more enabled checks. Checks to exclude can be prefixed with the ! character. If no checks are specified, all enabled checks are targeted. For example: --check-name=shortname1,shortname2,!shortname3

Required

LIQUIBASE_COMMAND_AUTO_ENABLE_NEW_CHECKS=<true|false>

LIQUIBASE_COMMAND_CHECKS_COPY_AUTO_ENABLE_NEW_CHECKS=<true|false>

Automatically enable new quality checks in liquibase.checks.conf file when they are available. Default: false.

Optional

LIQUIBASE_COMMAND_AUTO_UPDATE=<string>

LIQUIBASE_COMMAND_CHECKS_COPY_AUTO_UPDATE=<string>

Allows automatic backup and updating of the liquibase.checks-settings.conf file when new quality checks are available. Valid values are ON and OFF. Default: OFF.

Optional

LIQUIBASE_COMMAND_CHECKS_SETTINGS_FILE=<string>

LIQUIBASE_COMMAND_CHECKS_COPY_CHECKS_SETTINGS_FILE=<string>

Specifies the checks settings file to use with commands. Write the relative path of the settings file that you want to read from or modify. For more information, see Use the Checks Settings Configuration File.

Optional

Related links