Modify Liquibase Commands with Node.js
Last updated: July 14, 2025
This guide outlines adding or modifying Liquibase commands in the Liquibase Node package. It is designed for developers who want to extend the package's functionality.
Files to be Changed:
src/commands-with-positional-arguments.ts
src/liquibase-commands.enum
node-liquibase/src/models/commands (corresponding command file)
node-liquibase/src/liquibase.spec.ts
node-liquibase/src/liquibase.ts
Procedure
Follow these steps carefully to extend the functionality of the Liquibase Node package according to your requirements.
Note: This guide assumes familiarity with TypeScript and the Liquibase Node package structure. If you encounter any issues, refer to the Node.js and Liquibase documentation or seek assistance from the community.
Update commands-with-positional-arguments.ts and liquibase-commands.enum
Navigate to the src directory of the Liquibase Node package.
Open
commands-with-positional-arguments.ts
andliquibase-commands.enum
files.Add or modify the command with its positional (if needed) arguments in these files.
Modify command and its arguments in node-liquibase/src/models/commands
Go to the
node-liquibase/src/models/commands
directory.Locate the corresponding command file based on the command you added or modified.
Add or modify the command and its arguments in the respective file.
Define commands in node-liquibase/src/liquibase.spec.ts
Navigate to the
node-liquibase/src
directory.Open
liquibase.spec.ts
file.Define each command and indicate which run method it should invoke.
Implement invoke method in node-liquibase/src/liquibase.ts
Go to the
node-liquibase/src
directory.Open
liquibase.ts
file.Implement the invoke method for each command specified in
liquibase.spec.ts
.