ChangeTruncateTableWarn

This check warns a user when a table is being truncated so that they can ensure this change will not lead to unintentional data loss.

Uses

Use the check to warn when a table is being truncated, which is a significant database change which can destroy your organization’s most essential resource: critical data. Such an unintended change can result in permanent and irrecoverable data loss, production level service outages, and more. This quality check, like other checks, can be configured with a severity level which returns an exit code designed to stop automated jobs, giving your team time to inspect these significant changes.

Run the ChangeTruncateTableWarn check

The ChangeTruncateTableWarn check is enabled by default, so you will not need to turn it on if you have not changed your settings previously. To run the ChangeTruncateTableWarn check, ensure you have a Liquibase Pro license and the checks-scope property includes changelog. The checks-scope parameter is set in the default properties file, environment variable, or any standard method. Then, check the changelog to see if ChangeTruncateTableWarn is enabled.

Note: Please be aware that ChangeTruncateTableWarn only supports unmodeled changeset types. If you use this Quality Check with modeled changesets (XML, JSON, and YAML changelogs as well as all ChangeTypes except sql and sqlFile), a message will appear stating the changeset was skipped.

Enable the ChangeTruncateTableWarn check by running the following command in the CLI:

liquibase checks enable --check-name=ChangeTruncateTableWarn
Short Name Scope Enabled Severity Customization Description
ChangeTruncateTableWarn changelog

true

Default value: 1

  • 'INFO' | 0
  • 'MINOR' | 1
  • 'MAJOR' | 2
  • 'CRITICAL' | 3
  • 'BLOCKER' | 4

<None>

This check warns a user when a table is being truncated so that they can ensure that truncating the table won't lead to unintentional loss of data.