Relationships

Installing a foreign key

When installing foreign keys, a relationship is created between objects. Dependent objects (child objects) and dependent objects (base objects) appear. Setting foreign keys is the process of creating a link from a child object to the base object.

In SQL, a foreign key is a reference to the primary key of the base object, and only a table can have a primary key. In “Abris”, a virtual foreign key can refer to a view if it has a virtual primary key.

The following types of connections are possible:

  • the table refers to the table;
  • the table refers to the view;
  • the view refers to a table;
  • the view refers to the view.

Virtual keys are not displayed in the database.

  1. Go to alt [Menu] > [Configuration] > [Entities] > [Selected entity] > [Properties](or [Configuration] > [Schemas] > [Selected scheme] > [Entities] > [Selected entity] > [Properties]).

  2. In the detailed form, click alt [Edit] to switch to edit mode.

  3. Set the flag in the field “Is foreign key” and fill in the required field: “Reference entity”. Description of all fields in Properties.

  4. Click the button alt [Save] to save changes or click alt [Cancel] to exit the edit mode without saving.