Setting a foreign key #
Setting foreign keys creates a relationship between objects.appear Dependent objects (children) and those with dependencies (base). Setting foreign keys is the process of creating a link from a child to a base object.
In SQL, a foreign key is a reference to the primary key of the underlying object, and only a table can have a primary key. In Outline, a virtual foreign key can refer to a view if it has a virtual primary key.
The following types of links are possible:
- a table refers to a table;
- the table refers to the view;
- the view refers to the table;
- the view refers to the view.
Virtual keys are not displayed in the database.
Go [Menu] > [Configuration] > [Entities] > [Selected entity] > [Properties](or [Configuration] > [Schemas] > [Selected scheme] > [Entities] > [Selected entity] > [Properties]).
In the detailed form, press the button [Edit] to switch to edit mode.
Set the flag in the field * “Is foreign key” * and fill in the required field: * “Reference entity” *. Description of all fields in Properties/Columns.
Click the button [Save] to save changes or click [Cancel] to exit edit mode without saving.