run

The run subcommand executes checks using the checks settings file and the changelog file you specify. Quality checks support XML, SQL, YAML, and JSON changelog formats.

Uses

You can typically use the run command to run static and dynamic checks with the changelog and configuration files having default and non-default locations.

If your files are not stored in the Liquibase working directory, specify the relative path to them. Check How Liquibase Finds Files: Liquibase Classpath for more details.

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

Running the run command

Run the command specifying your values:

liquibase checks run --changelog-file=basicRule.postgres.sql

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.

The command runs the check and generates related information in the CLI output.

copy command attributes

Name Syntax Description
checks-settings-file

CLI:

--checks-settings-file

Property:

liquibase.command.checks.run.checksSettingsFile

Environment Variable:

LIQUIBASE_COMMAND_CHECKS_RUN_CHECKS_SETTINGS_FILE

The parameter which specifies the needed checks settings file to work with subcommands.

Set the checks-settings-file parameter to the relative path of the checks-settings-file that you want to read from or modify.

For more information, see Using the Checks Settings Configuration File.

check-name

CLI:

--check-name

Property:

liquibase.command.checks.run.checkName

Environment Variable:

LIQUIBASE_COMMAND_CHECKS_RUN_CHECK_NAME

The parameter which you must specify so that any of the following subcommands being executed can perform its function:

  • copy
  • customize
  • delete
  • disable
  • enable
  • reset

Set the check-name parameter to the short name for the check you want to target with one of the subcommands.

changelog-file

CLI:

--changelog-file

Property:

liquibase.command.checks.run.changelog-file

Environment Variable:

LIQUIBASE_COMMAND_CHECKS_RUN_CHANGELOG_FILE

The changelog file against which you execute checks when running liquibase run.
auto-update

CLI: --auto-update=[on|off]

Property: liquibase.command.checks.run.autoUpdate: [on|off]

Environment Variable: LIQUIBASE_COMMAND_CHECKS_RUN_AUTO_UPDATE=[ON|OFF]

The parameter which allows automatic backup and updating of the liquibase.check-settings.conf file when new quality checks are available.

Default: off

format

CLI: --format=[text|json]

Property: liquibase.command.checks.run.format: [text|json]

Environment Variable: LIQUIBASE_COMMAND_CHECKS_RUN_FORMAT=[TEXT|JSON]

Liquibase Pro only. Sets the format of the check output to text or JSON.

Default: text

For more information, see Quality Checks JSON Object.

Related links