Relations

A Relation or Relationship is a special named structure in a relational database that defines how data in one table is related to the data in another table. The Relation specifies the table and field names that are related, and its main task is to provide data integrity inside a database.

To see what relations are currently defined in the Schema, simply click on the Relations folder in the navigation tree view. This will present a view that displays any relations that are currently defined, and which tables and fields are related.

If you wish to add or delete a Relation then you can use the available "Add New Relation" or "Remove Relations" buttons. Its also possible to right click on a the Relations folder and add or delete a relation.

Adding/Editing a new Relation

The first step to defining a relationship is to specify the name of the relationship, this should be a unique value that provides a useful description. After that you need to specify the type of relationship being defined, will the tables be related based on a specific Forigen Key, or is it a Master - Detail relationship where one the parent table is the Master and the child table is the Detail.

Then for each of the Parent and Child sections, you need to choose the table using the available drop-down and then start typing the key name(s). The editor will then offer autocompletions based on the fields in the specified table.

When you have made modifications to the Relation you will see a black dot in the Red window control which will indicate the Schema needs to be saved. Which you can do by clicking on File->Save or Cmd+S. You can also discard the changes you've made if you are unhappy with them with File->Revert to Saved.