Defining relations in a Vortex instance

This guide will show you how to setup and define relations between tables in a Vorted DBI.

Requirements

Overview

In the Vortex there are three types of relations between tables.

Relation fields

For the first two relation types, 1-1 and 1-x, the record on the 1-side contains a field pointing to the related record, where the record on the x-side doesn't have this field but instead has a list of related records.

To create a relation field, simply create a field in the table of type Relation and give it a suiting name and description.

Setting up the relation

When the required tables and fields are created, open the Admin menu and choose Relations. An in detail description of relations is given in the User Manual

  1. Choose the first table in the Table1 column
  2. Enter a name for the first table in Name1, ie what is related, would be owner if Table1 was a car having one owner
  3. Enter a description for the first table in Description1, would be My Owner in the example above
  4. Choose the second table in the Table2 column
  5. Enter an name for the second table in Name2, would be cars in the example above
  6. Enter a description for the second table in Description2, would be Cars owned by person in the example
  7. Choose a type in the Type dropdown list, for the cars/owner example above this would be 1-x
  8. If the type is 1-1 or 1-x, choose the related field in Field1, would be the owner field in the car table in the example. Choose this by right-clicking the i symbol and choosing Field, only relation fields are shown in the list.
  9. If the type is 1-1, choose the related field from the second table in Field2

Observe that it is very important that the right field for the right table is chosen in the Field columns, otherwise behaviour of theese tables will be erratic!

Saving the relation makes the connection between the tables active.