reset
Note: This is a Liquibase Pro feature, so you need a Liquibase Pro License Key to use it.
The reset
subcommand reverts customizations made to the check indicated in the --check-name
parameter to the original configuration.
Uses
You can typically use the reset
command to return to a reliable starting state when working with checks. This subcommand does not affect static checks and uncustomized dynamic checks.
When resetting a dynamic check that has been customized multiple times, the check will be reverted to default settings and not to the previous customized settings.
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:
-
Run the command specifying your values:
liquibase checks reset --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. - Confirm the change. The command updates the check in the checks settings file.
Command arguments
The following table identifies parameters that are accepted or required by the reset
subcommand. If the Default column states "Required," it is required to run the command successfully. If it states "Null," it is an optional command argument. Each command argument helps you narrow down the liquibase checks reset
command to ensure that only very specific content is affected by the command.
Tip: For best results, specify all commands and parameters in the --kebab-case
format in the CLI. If your preference is camelCase, it also works in the CLI.
Name | Default | Syntax | Description |
---|---|---|---|
check-name (String) |
Required |
CLI: Property: Environment Variable: |
Use this to specify the short name of the check you want to target with one of the following subcommands:
|
checks-settings-file (String) |
Null |
CLI: Property: Environment Variable: |
Specifies the checks settings file to use with subcommands. 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. |
auto-update (String) |
Null |
CLI: Property: Environment Variable: |
Allows automatic backup and updating of the Default: off |
reset
example output
$ liquibase checks reset --checkname=TableColumnLimit
Starting Liquibase at 13:30:04 (version 4.9.1 #1978 built at 2022-03-28 19:39+0000)
Liquibase Version: 4.9.1
Resetting check with short name 'TableColumnLimit' to original configuration of its base check 'TableColumnLimit'
Current Customization Settings
Severity = INFO MAX_COLUMNS = '20'
Default Settings
Severity = INFO MAX_COLUMNS = '50'
Would you like to set 'TableColumnLimit' to it's default settings? (Y/n) [Y]:
Y
Reset complete. Review the table below to confirm your changes.
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
| # | 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 | 0 |
| | | | 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 | | | |
+-----+--------------------------------+----------------------------+--------------------------------+---------+--------------------------------+----------+
TIP
Test your changes by running checks against your changelog with 'liquibase checks run'
Liquibase command 'checks reset' was executed successfully.