Modify Liquibase Commands with Node.js
This guide outlines the process of adding or modifying Liquibase commands in the Liquibase Node package. It is designed for developers who want to extend the functionality of the package.
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
Step-by-step guide
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.
Step 1: 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.
Step 2: 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.
Step 3: 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.
Step 4: 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
.