modifyChangeSets

Last updated: September 2, 2025

logicalFilePath

The modifyChangeSets tag lets you include SQL scripts in your Liquibase changelog while using an application's native executor—like PSQL, SQL Plus, or SQLCMD—instead of the JDBC default to deploy raw SQL scripts with a native executor.

This removes the burden of converting raw SQL scripts into formatted SQL changelogs. You can use it to specify an overarching executor for all files in your project. Available in Liquibase 4.18.0+.

Uses

If you have many changesets that need to be run with a native executor, and you organize your changelogs in a "root" and "nested" format using the include and includeAll tags, you can use the runWith attribute (PSQL, SQLPlus, or SQLCMD) to specify an executor that applies to every changeset in every file wrapped in the modifyChangeSets tag. Since your nested changelogs inherit the executor specified in modifyChangeSets, you don't have to specify it on each individual changeset you include.

If you want to make an exception for a particular changeset you're including, you can specify the default Liquibase JDBC executor for that changeset. All other changesets still run with the executor inherited from modifyChangeSets.

You can still include additional files in your root changelog outside of the modifyChangeSets tag. These files run with the Liquibase JDBC executor.

Run modifyChangeSets

To run this Change Type, follow these steps:

  1. Add the Change Type to your changeset, as shown in the examples on this page.

  2. Specify any required attributes. Use the table on this page to see which ones your database requires.

  3. Deploy your changeset by running the update command:liquibase update

Syntax

Attributes

Attribute

Type

Description

Support

runWith

String

Specifies which executor to run the changeset with. Options: jdbc, mongosh, psql, sqlPlus, sqlcmd, <custom>

JdbcExecutor, MongoDB, PostgreSQL, Oracle, MSSQL, and custom executors. Default: jdbc

failOnError

Boolean

Determines whether to fail the entire operation when a changeset encounters an error. When set to false, errors are logged but execution continues. Default: true

Note: You can set failOnError on a single changeset or via modifyChangeSets. The value set at the changeset level will be prioritized for that changeset if it is set in both places.

Only available to Liquibase Secure users.

endDelimiter

String

Specifies delimiter to apply to the end of the statement. Your delimiter string can be a combination of one or more letters, symbols, and/or numbers, or the empty string (""). Default: ";". See also: --secure-global-end-delimiter and --secure-global-end-delimiter-prioritized.

It is a best practice not to use endDelimiter on changesets you are running with a native executor. Native executors handle delimiters natively.

In Liquibase 4.25.1 and later, you can use endDelimiter with modifyChangeSets to apply a delimiter to all changesets you reference with include and includeAll.

endDelimiter is similar to the --secure-global-end-delimiter parameter, but has a local scope. If both parameters are set, they follow the following precedence:

1. endDelimiter set on a specific changeset, including in rollbackSqlFile (highest precedence)

2. endDelimiter set in a changelog called by include or includeAll in modifyChangeSets

3. --secure-global-end-delimiter set globally (lowest precedence)

all

stripComments

Boolean

When true, removes any comments in the statement before executing. If false, Liquibase does not remove any comments. Default: true.

In Liquibase 4.31.0 and later, you can use stripComments with modifyChangeSets to strip comments within all changesets you reference with include and includeAll.

stripComments is similar to the --secure-global-strip-comments parameter, but has a local scope. If both parameters are set, they follow the following precedence:

1. stripComments set on a specific changeset, including in rollbackSqlFile (highest precedence)

2. stripComments set in a changelog called by include or includeAll in modifyChangeSets

3. --secure-global-strip-comments set globally (lowest precedence)

all

Nested tags

Name

Description

Required for

Supports

include

Includes the specified changelog

none

all

includeAll

Includes the specified directory of changelogs

none

all

modifyChangeSets examples

databaseChangeLog:
- modifyChangeSets:
    runWith: sqlplus
    endDelimiter: @
    include:
      - file: my/nested/changelog.xml
    includeAll:
      - path: release200/changelogs/sql
- include:
    file: sql/another.sql

*Example: deploy a single raw SQL file*

databaseChangeLog:
- modifyChangeSets:
  - runWith: psql
  - include:
	   file: my-psql-script.sql
       relativeToChangelogFile: true

  *Example: deploy a directory of raw SQL files*  

 databaseChangeLog:
- modifyChangeSets:
  - runWith: psql
  - includeAll:
       path: /raw-psql-scripts-directory