Extending the data migration script

Changes to special tables in previous versions of WebSphere Commerce requires you to alter the data migration script prior to migrating your database.

Procedure

  1. Navigate to:
    • WC_installdir/schema/migration/xx/database_type
    • WindowsWC_installdir\schema\migration\xx\database_type

      Where:

    • xx is either 561 or 60.
    • database_type is:
      • DB2db2
      • Oracleoracle
      • Apache Derbydb2\cloudscape
      • For IBM i OS operating systemdb2\os400
  2. Open the recreate.tables.txt file.
  3. Check if you have modified any of the tables listed in the file. If you haven't modified any of the tables in the file, you can skip the remainder of this task. If you have, continue with the remaining steps in this task.

    The example used in the remaining steps assumes you have a custom column called EXAMPLECOLUMN which has been added to the CATENTRYATTR table as INTEGER DEFAULT 0, and has a foreign key to the MBRGRP table.

  4. Locate the wcs.schema.recreate.tables.sql script file.
  5. Modify the script file by adding the following SQL statement at the end of the file:
    • For IBM i OS operating systemApache DerbyDB2alter table catentryattr add column examplecolumn integer default 0;
    • Oraclealter table catentryattr add examplecolumn integer default 0 null;
  6. Save the updated wcs.schema.recreate.tables.sql file.
  7. Navigate to WC_installdir/schema/database_type.
  8. Make a copy of the file wcs.referential.sql, in the same directory and rename it to wcs.referential_instance.sql.
  9. Modify the wcs.referential_instance.sql file to add a referential constraint:
    ALTER TABLE CATENTRYATTR ADD CONSTRAINT F_EXAMPLECOLUMN FOREIGN KEY (EXAMPLECOLUMN) REFERENCES MBRGRP ON DELETE CASCADE;
  10. Save the file.

What to do next

Migrating the database