Docs Menu
Docs Home
/
Relational Migrator
/ /

Add a Synthetic Foreign Key

On this page

  • Steps
  • Next Steps
  • Learn More

Use synthetic foreign keys to establish relationships between your tables before creating mapping rules. A synthetic foreign key represents a relationship between two tables, but unlike a regular foreign key, it does not exist in the source database and can be defined directly using Relational Migrator.

  1. On the diagram toolbar, click Add a synthetic foreign key.

  2. Select the parent table.

    You can select a parent table in two ways:

    • Click on a single table or,

    • Click and drag between your choice of parent and child table. If you select your parent and child table in this manner, step 5 is completed.

  3. On the Add relationship pane, select the cardinality.

    • When you select One to one, each row in the parent table must relate to at most one row in the child table.

    • When you select One to many, each row in the parent table can relate to zero or more rows in the child table.

  4. Click the Parent field drop-down and select a parent field.

  5. Click the Child table drop-down and select a child table.

    To represent the potential relationship, a blue line appears between the parent table and child table on the relational model.

  6. Click the Child field drop-down and select a child field.

    Select a child field whose values correspond to those in the parent field.

  7. Click Save and close.

← Synthetic Foreign Keys