Reusing custom staging triggers

If we created custom tables with staging triggers in a previous version of WebSphere Commerce, we can continue to use our custom triggers. Run the provided scripts to allow the unchanged custom triggers to continue to use the KEYS table to maintain the primary key values of the STAGLOG table.

Note: Alternatively, we can update your existing staging triggers for better performance and scalability. For an example of how to update your trigger, see Staging trigger example.


Procedure

  1. Retrieve the files from the Utility server Docker container by performing one of the following actions.

    1. Retrieve the files from the development environment.

      • (DB2) WCDE_installdir/schema/9.0.0.0/db2/wcs.stage.heteroTriggerSupport.sql

      • (Oracle) WCDE_installdir/schema/9.0.0.0/oracle/wcs.stage.heteroTriggerSupport.sql

    2. Retrieve the files from the Utility server Docker container.

      1. Run docker ps to verify that the containers are running.

      2. Locate the utility container name in the NAMES column. For example, myproject_utils_1.

      3. Run docker cp to copy the appropriate files from the Utility server Docker container to your local system.

          docker cp utility_container_name:container_file_path local_directory

        Where The container_file_path for the drop triggers script is

        • (DB2) utilities_root/schema/9.0.0.0/db2/wcs.stage.heteroTriggerSupport.sql

        • (Oracle) utilities_root/schema/9.0.0.0/oracle/wcs.stage.heteroTriggerSupport.sql

  2. Connect to the staging database.

    • (DB2) db2 connect to stagingdbuser db_user using db_password

    • (Oracle) sqlplus db_user/db_password@stagingdb

  3. Run the following script:

      db2 -td# -vf wcs.stage.heteroTriggerSupport.sql


Related concepts
Staging environment