pro-global-strip-comments

--pro-global-strip-comments is a global Boolean parameter that specifies whether to remove any comments in a SQL statement before executing. It is available in Liquibase 4.29.2 and later and requires a valid Liquibase Pro license key to use. The default value is true.

The --pro-global-strip-comments parameter is similar to the stripComments attribute for the sql, sqlFile, partiql, and partiqlFile Change Types, but has a global scope.

If you set --pro-global-strip-comments and do not set stripComments, then Liquibase applies the value of --pro-global-strip-comments to all changesets. If you set both, Liquibase determines which value to use for a changeset in the following order:

  1. stripComments set on a specific changeset, including in rollbackSqlFile (highest precedence)
  2. --pro-global-strip-comments set globally (lowest precedence)

You can give --pro-global-strip-comments the highest precedence of all settings by also using the --pro-global-strip-comments-prioritized parameter.

Uses

By default, Liquibase strips SQL comments from any SQL changesets you deploy. However, you may want to keep the comments because they serve as documentation or version control.

You can use --pro-global-strip-comments to set comment stripping behavior across all your changesets. This is easier than manually specifying stripComments on every individual changeset. Also, having one central parameter for comment stripping behavior reduces inconsistencies resulting from manual updates to changesets.

Note: This parameter does not override the strip_comments(SQL_string) helper function in Checks Python API Helper Scripts. The custom policy check uses the original SQL from the Change object.

Syntax

You can set this parameter in the following ways:

Option Syntax
Liquibase properties file (defaults file)
liquibase.pro.globalStripComments: <true|false>
Global flow file argument (example)
stages:
  Default:
    actions:
      - type: liquibase
        command: update
        globalArgs: { pro-global-strip-comments: "<true|false>" }
Global CLI parameter
liquibase
 --pro-global-strip-comments=<true|false> update
 --changelog-file=example-changelog.xml

JVM system property (JAVA_OPTS Environment Variable)

JAVA_OPTS=-Dliquibase.pro.globalStripComments=<true|false>
Liquibase Environment Variables
LIQUIBASE_PRO_GLOBAL_STRIP_COMMENTS=<true|false>

For more information, see Working with Command Parameters.

Related links