CheckRunInTransactionValue
This check triggers when a changeset contains the user-specified runInTransaction
value of true
or false
.
Note: Changesets without a runInTransaction
value are not checked.
About CheckRunInTransactionValue |
|
---|---|
Liquibase version required | 4.27.0+ |
Scope (--checks-scope ) |
changelog
|
Default status | enabled
|
Default severity (exit code) | 0 ("INFO ") |
Customizable settings | Yes (dynamic) |
Uses
This check verifies whether your changesets contain runInTransaction=true
or runInTransaction=false
.
If true
, runInTransaction
attempts to deploy changes in a single atomic transaction, which can reduce the possibility of incomplete deployments. If you rely on runInTransaction
to deploy your changesets all together, this check can prevent you from accidentally deploying changesets individually.
If Liquibase detects that your changesets violate the policy you configure with this check, it outputs a message and reacts according to the severity level you specify for the check.
Use CheckRunInTransactionValue
Prerequisites
- Ensure that you have correctly specified your Liquibase Pro license key.
- 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.
- If you want to customize any default values of this check, run the
customize
command: - When finished, verify that your configuration is correct by running the
show
command:
liquibase checks customize --check-name=<string>
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
Name | Type | Description | Customization | Default Value |
---|---|---|---|---|
MESSAGE
|
String |
The output printed when the check detects a pattern match |
Any string. All characters are allowed. |
A match for regular expression <SEARCH_STRING> was detected in Changeset <CHANGESET>
|
RUN_IN_TRANSACTION_VALUE
|
String |
Value of |
Must be |
false
|
liquibase checks enable --check-name=ChangesetAttributesSetTrueOrFalse
example output
Check 'ChangesetAttributesSetTrueOrFalse' has been enabled.
+-------------------------------------+------------+----------+----------+--------------------------------+--------------------------------+
| Short Name | Scope | Status | Severity | Customization | Description |
+-------------------------------------+------------+----------+----------+--------------------------------+--------------------------------+
| ChangesetAttributesSetTrueOrFalse | changelog | disabled | 0 | ATTRIBUTE = null | This check triggers when |
| | | | | SEARCH_STRING = null | specified attributes do not |
| | | | | | match TRUE or FALSE, as |
| | | | | | configured by the user. |
+-------------------------------------+------------+----------+----------+--------------------------------+--------------------------------+
Liquibase command 'checks enable' was executed successfully.