bulk-set
Note: This is a Liquibase Pro feature, so you need a Liquibase Pro License Key to use it.
The bulk-set
subcommand sets all qualifying quality checks to the same value. It helps you perform bulk management operations without running similar checks commands multiple times.
Uses
The bulk-set
command allows you to modify all qualifying quality checks at once using the --enable
, --disable
, and --severity
flags.
Example Scenario
For example, in a few commands, you can disable all your quality checks, set all severity exit codes to 0
, and then pick a couple of them to enable and set the appropriate severity level. Let’s say you have 30 quality checks with different priorities. However, you want to reset them all to have a severity of 0
and configure only a few to have a severity of 4
, which you have set in your CI/CD tool as an exit code that stops your jobs. In this instance, you would run liquibase checks bulk-set --severity=0
. to set them all to 0, then you would update the couple you want to severity 4 for with liquibase checks customize --checkname=<someCheckShortName1>
and liquibase checks customize --checkname=<someCheckShortName2>
.
Note: You cannot enable the checks that do not have the default value. You need to copy and customize them first.
Note: To view a list of available checks, run liquibase checks show
.
Syntax
You can run the bulk-set
command as follows:
liquibase checks bulk-set --disable
liquibase checks bulk-set --enable
liquibase checks bulk-set --severity=[INFO|MINOR|MAJOR|CRITICAL|BLOCKER]
liquibase checks bulk-set --severity=[0|1|2|3|4]
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.
The command is interactive, so to skip the confirmation in automation, use the --force
flag with another bulk-set
flag.
liquibase checks bulk-set --severity=INFO --force
You can pass only one flag at a time. For example, to enable checks and set them to severity=MINOR
, run two bulk-set
commands, as follows.
Example: liquibase checks bulk-set --enable
liquibase checks bulk-set --severity=MINOR
Parameters
Global parameters
Parameter | Definition | Requirement |
---|---|---|
|
Your Liquibase Pro license key |
Required |
Command parameters
Parameter | Description | Requirement |
---|---|---|
|
Disable all qualifying checks in the checks settings file. Default: |
Required (either this or --enable must be true ) |
|
Enable all qualifying checks in the checks settings file. Default: |
Required (either this or --disable must be true ) |
|
Automatically enable new quality checks in |
Optional |
|
Allows automatic backup and updating of the |
Optional |
|
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 |
|
If |
Optional |
|
Set the severity to return a code of 0–4 when the check is triggered. Default: |
Optional |
Global parameters
Parameter | Definition | Requirement |
---|---|---|
|
Your Liquibase Pro license key |
Required |
Command parameters
Parameter | Description | Requirement |
---|---|---|
|
Disable all qualifying checks in the checks settings file. Default: |
Required (either this or --enable must be true ) |
|
Enable all qualifying checks in the checks settings file. Default: |
Required (either this or --disable must be true ) |
|
Automatically enable new quality checks in |
Optional |
|
Allows automatic backup and updating of the |
Optional |
|
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 |
|
If |
Optional |
|
Set the severity to return a code of 0–4 when the check is triggered. Default: |
Optional |
Global parameters
Parameter | Definition | Requirement |
---|---|---|
|
Your Liquibase Pro license key |
Required |
Command parameters
Parameter | Description | Requirement |
---|---|---|
|
Disable all qualifying checks in the checks settings file. Default: |
Required (either this or --enable must be true ) |
|
Enable all qualifying checks in the checks settings file. Default: |
Required (either this or --disable must be true ) |
|
Automatically enable new quality checks in |
Optional |
|
Allows automatic backup and updating of the |
Optional |
|
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 |
|
If |
Optional |
|
Set the severity to return a code of 0–4 when the check is triggered. Default: |
Optional |
Global parameters
Parameter | Definition | Requirement |
---|---|---|
|
Your Liquibase Pro license key |
Required |
Command parameters
Parameter | Description | Requirement |
---|---|---|
|
Disable all qualifying checks in the checks settings file. Default: |
Required (either this or --enable must be true ) |
|
Enable all qualifying checks in the checks settings file. Default: |
Required (either this or --disable must be true ) |
|
Automatically enable new quality checks in |
Optional |
|
Allows automatic backup and updating of the |
Optional |
|
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 |
|
If |
Optional |
|
Set the severity to return a code of 0–4 when the check is triggered. Default: |
Optional |
Global parameters
Parameter | Definition | Requirement |
---|---|---|
|
Your Liquibase Pro license key |
Required |
Command parameters
Parameter | Description | Requirement |
---|---|---|
|
Disable all qualifying checks in the checks settings file. Default: |
Required (either this or --enable must be true ) |
|
Enable all qualifying checks in the checks settings file. Default: |
Required (either this or --disable must be true ) |
|
Automatically enable new quality checks in |
Optional |
|
Allows automatic backup and updating of the |
Optional |
|
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 |
|
If |
Optional |
|
Set the severity to return a code of 0–4 when the check is triggered. Default: |
Optional |
bulk-set
example output
Liquibase Version: 4.9.1
IMPORTANT: Are you sure you want to set all the checks to severity 'MINOR' (1)>? (Y/N): [N]:
Y
All qualifying checks have been set to severity 'MINOR'.
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| # | Check Name | Short Name | Description | Enabled | Customization | Severity |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 10 | Warn on Detection of 'GRANT' | SqlGrantWarn | This check warns a user when | true | None | 1 |
| | Statements | | SQL contains 'GRANT' | | | |
| | | | statements so that they can | | | |
| | | | ensure that the privilege | | | |
| | | | being granted won't lead to | | | |
| | | | security issues. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 20 | Warn on Detection of 'REVOKE' | SqlRevokeWarn | This check warns a user when | true | None | 1 |
| | Statements | | SQL contains 'REVOKE' | | | |
| | | | statements so that they can | | | |
| | | | ensure that the privilege | | | |
| | | | being revoked won't lead to | | | |
| | | | data access and dependency | | | |
| | | | issues. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 30 | Warn when 'DROP TABLE' | ChangeDropTableWarn | This check warns a user when a | true | None | 1 |
| | detected | | table is being dropped so that | | | |
| | | | they can ensure that dropping | | | |
| | | | the table won't lead to | | | |
| | | | unintentional loss of data. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 40 | Warn when 'DROP COLUMN' | ChangeDropColumnWarn | This check warns a user when a | true | None | 1 |
| | detected | | column is being dropped so | | | |
| | | | that they can ensure that | | | |
| | | | dropping the column won't lead | | | |
| | | | to unintentional loss of data. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 50 | Warn when 'MODIFY column' | ModifyDataTypeWarn | This check warns a user when a | true | None | 1 |
| | detected | | change will result in | | | |
| | | | modification of a data type so | | | |
| | | | they can ensure that modifying | | | |
| | | | the data type won't lead to | | | |
| | | | unintentional loss of data | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 60 | Check for specific patterns in | SqlUserDefinedPatternCheck | This check scans raw SQL for | false | SEARCH_STRING = null | 1 |
| | sql | | the presence of specific | | MESSAGE = A match for regular | |
| | | | patterns and warns the user | | expression SEARCH_STRING was | |
| | | | when they are found. | | detected in Changeset | |
| | | | | | CHANGESET. | |
| | | | | | STRIP_COMMENTS = true | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 70 | Check Table Column Count | 1234 | Ensures that no table has more | true | MAX_COLUMNS = 5 | 1 |
| | | | than a threshold number of | | | |
| | | | columns. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 70 | Check Table Column Count | TableColumnLimit | Ensures that no table has more | true | MAX_COLUMNS = 50 | 1 |
| | | | than a threshold number of | | | |
| | | | columns. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 80 | Object name pattern match | ObjectNameMustMatch | This check confirms the listed | false | OPERATOR = STARTS_WITH | 1 |
| | | | object names conform to the | | SEARCH_STRING = null | |
| | | | supplied pattern. | | OBJECT_TYPES = null | |
| | | | | | CASE_SENSITIVE = true | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 85 | Object name pattern not match | ObjectNameMustNotMatch | This check confirms the listed | false | OPERATOR = STARTS_WITH | 1 |
| | | | object names do not match the | | SEARCH_STRING = null | |
| | | | supplied pattern. | | OBJECT_TYPES = null | |
| | | | | | CASE_SENSITIVE = true | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 90 | Warn on Grant of Specific | SqlGrantSpecificPrivsWarn | This check warns a user when | false | PRIVILEGE_LIST = null | 1 |
| | Privileges | | changeset includes or | | | |
| | | | generates sql that grants | | | |
| | | | specific privileges to a user | | | |
| | | | or role | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 100 | Warn when 'TRUNCATE TABLE' | ChangeTruncateTableWarn | This check warns a user when a | true | None | 1 |
| | detected | | table is being truncated so | | | |
| | | | that they can ensure that | | | |
| | | | truncating the table won't | | | |
| | | | lead to unintentional loss of | | | |
| | | | data. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 110 | Warn on Detection of grant | SqlGrantOptionWarn | This check warns a user when | true | None | 1 |
| | that contains 'WITH GRANT | | SQL contains 'GRANT' | | | |
| | OPTION' | | statements that include the | | | |
| | | | 'WITH GRANT OPTION' clause so | | | |
| | | | that they can ensure that the | | | |
| | | | privilege being granted won't | | | |
| | | | lead to security issues | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 130 | Warn on Detection of grant | SqlGrantAdminWarn | This check warns a user when | true | None | 1 |
| | that contains 'WITH ADMIN | | SQL contains 'GRANT' | | | |
| | OPTION' | | statements that include the | | | |
| | | | 'WITH ADMIN OPTION' clause so | | | |
| | | | that they can ensure that the | | | |
| | | | privilege being granted won't | | | |
| | | | lead to security issues | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 160 | Rollback Required for | RollbackRequired | This check triggers when a | true | None | 1 |
| | Changeset | | changeset does not have a | | | |
| | | | rollback defined. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 170 | Changesets Must Have a Label | ChangesetLabelCheck | This check enforces the | true | None | 1 |
| | Assigned | | Liquibase recommendation that | | | |
| | | | labels be assigned to each | | | |
| | | | changeset to provide better | | | |
| | | | deployment control and to | | | |
| | | | enhance traceability of | | | |
| | | | efforts across changesets. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 173 | Changesets Must Have a Context | ChangesetContextCheck | This check enforces the | true | None | 1 |
| | Assigned | | Liquibase recommendation that | | | |
| | | | contexts be assigned to each | | | |
| | | | changeset to provide better | | | |
| | | | deployment control and to | | | |
| | | | enhance traceability of | | | |
| | | | efforts across changesets. | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| 176 | Changesets Must Have a Comment | ChangesetCommentCheck | This check enforces the | true | None | 1 |
| | Assigned | | Liquibase recommendation that | | | |
| | | | comments be added to each | | | |
| | | | changeset to document the | | | |
| | | | purpose of a changeset for | | | |
| | | | other/future consumers of this | | | |
| | | | changelog | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
Liquibase command 'checks bulk-set' was executed successfully.