executeCommand
The executeCommand
Change Type executes a system command.
Note: Using Liquibase commands such as migrateSQL
may not work as expected because the executeCommand
Change Type doesn't generate SQL. To resolve this, use Change Types that generate SQL.
Uses
You can typically use the executeCommand
Change Type to run a script using a specific executable. One reason to use executeCommand
is to insert or update data.
Running the executeCommand
Change Type
To run this Change Type, follow these steps:
Add the Change Type to your changeset, as shown in the examples on this page.
Specify any required attributes. Use the table on this page to see which ones your database requires.
Deploy your changeset by running the
update
command:liquibase update
Available attributes
Name | Description | Required for | Supports |
| The name of the executable to run | all | all |
| The list of operating systems on which to execute the command (taken from the | all | |
| The timeout value for executable to run | all |
Nested tags
Name | Description | Required for | Supports | Multiple allowed |
| Arguments for the executable | all | yes |
Nested property attributes
Name | Description | Required for | Supports | Multiple allowed |
| The value of the attribute (for example: |
executeCommand examples
databaseChangeLog:
- changeSet:
id: executeCommand-example
author: liquibase-docs
changes:
- executeCommand:
args:
- arg:
value: '-out'
- arg:
value: '-param2'
executable: mysqldump
os: Windows 7
timeout: 10s