Foreign Keys

The Foreign Keys page lists out all foreign key relationships that Tonic will adhere to when synthesizing or subsetting your data, and when applying generators to columns that are either a foreign key or a primary key. Upon connecting a source database, Tonic will list out all of the foreign key relationships that have been explicitly constrained in the database - these cannot be changed or removed through Tonic. Additionally, you'll also be able to easily specify any other foreign key relationships that you need Tonic to take into consideration.

Viewing Foreign Key Relationships

  1. You can toggle between viewing all foreign key relationships or adding foreign key relationships

  2. You can search for particular foreign key relationships

  3. Foreign key relationships that have a checkbox are virtual foreign key relationships that you created

  4. Virtual foreign key relationships can be deleted

  5. Foreign key relationships set at the database level are designated with a lock indicating that you cannot delete or make changes to them via Tonic

Add Foreign Key Relationships

  1. You can search for any particular foreign key column to quickly filter through the list

  2. You can select the column that will act as the foreign key by checking the box. You may select multiple foreign key columns.

  3. A dropdown of all possible primary key columns will be shown. A primary key is required to create a foreign key relationship.

  4. To complete the foreign key relationship creation process, click the button to create the foreign key relationships

  5. A preview of all foreign key relationships that Tonic will create will be listed here. You may delete the ones you do not want.