Enable custom tables for staging
If you have customized the database schema by creating new tables and we want to stage these custom tables, perform the following steps for each custom table we want to stage.
Procedure
- Identify the scope of the customized table:
- Site data
- The table records contain site changes. For example, new taxes or currencies.
- Merchant data
- The table records contain store changes. For example, the STORE and CATENTRY tables are merchant tables. Typically, when a store ID exists in the table, it is likely a merchant table.
- Mixed site and merchant data
- The table records contain both site and store changes. These hybrid tables are defined in the
STGSITETAB table. For hybrid tables, one of the table columns is used to decide whether the record is SITE or MERCHANT. This table column can be defined in the COLNAME column of the STGMRSTTAB table. For example, the MEMBER table uses MEMBER_ID to decide if the record is SITE or MERCHANT.
If the site is hosting several stores, we might be using one common staging environment. Sometimes we can propagate only site changes such as when we are adding a new tax or a new currency. Identifying the scope of each customized table can help you in this task. We can decide at the record level if a table contains site, merchant or mixed data depending on the records in that table. For example, if all the records contain site changes, then the table is a site table. If some records contain store changes and some site changes, it is a mixed table.
- In both the staging environment and the production environment, insert the customized table into the
STGSITETAB, STGMERTAB, or STGMRSTTAB table, depending on the scope of the table:
- For site tables, insert only into STGSITETAB.
- For merchant tables, insert only into STGMERTAB.
- For tables which contain both site and merchant data, insert into STGSITETAB, STGMERTAB, and STGMRSTTAB.
If we are inserting customized parent and child tables, ensure the TABNBR column value for the child tables are higher than the TABNBR column value for the parent tables. If our customized table is a parent table of a WebSphere Commerce table, ensure that the TABNBR column value for the customized table is lower than the TABNBR column value for the WebSphere Commerce table.
- On the staging environment, create database triggers for the custom database table to record changes to the custom database table to the STAGLOG table.
See
- Customized database table requirements
- Create triggers for custom tables
- Reuse custom staging triggers
- Rules for creating triggers for custom tables
- Staging trigger example