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

  1. Navigate to the src directory of the Liquibase Node package.
  2. Open commands-with-positional-arguments.ts and liquibase-commands.enum files.
  3. 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

  1. Go to the node-liquibase/src/models/commands directory.
  2. Locate the corresponding command file based on the command you added or modified.
  3. Add or modify the command and its arguments in the respective file.
  • Add or modify the command and its arguments in the respective file.
  • Step 3: Define commands in node-liquibase/src/liquibase.spec.ts

    1. Navigate to the node-liquibase/src directory.
    2. Open liquibase.spec.ts file.
    3. Define each command and indicate which run method it should invoke.

    Step 4: Implement invoke method in node-liquibase/src/liquibase.ts

    1. Go to the node-liquibase/src directory.
    2. Open liquibase.ts file.
    3. Implement the invoke method for each command specified in liquibase.spec.ts.

    Related Links