Skip to main content
Version: 2.0.0 (latest)

4.3. Relationships settings

The purpose of the Relationships section is to define global properties when creating relationships in the database model. The settings handled here vary from the mode in which relationship lines are drawn to the patterns used to generate the names of columns and constraints created by the relationships when connecting them to tables. Relationship settings are organized into three groups, Connection mode, Foreign key settings and Name patterns, and they are detailed right below.

Connection mode​

ch4.relationships-settings1234

Connection mode
#FieldDescription
1Crow's foot notation

This mode renders the relationships in crow's foot notation, which has better semantics and readability. It also determines the optimal point where the relationship is connected on the edges of the tables, taking their positions into account.

2Connect FK to PK columns

This mode is available only for one-to-one, one-to-many, and fk relationships, but provides better semantics when linking tables by placing the lines on the exact point where the relationship occurs. It implies the usage of the classical ER notation. With this mode, the foreign key columns of the receiver table are directly connected to the primary key columns of the reference table, which helps to quickly identify the columns that represent the relationship.

3Connect tables' edges

This mode determines the optimal point where the relationship is connected on the edges of the tables, taking their positions into account. It implies the usage of the classical ER notation.

4Connect tables' center points

This mode is the classical one. It connects the relationship to tables through their central points. It implies the usage of the classical ER notation. This mode makes the columns that determine the relationship more difficult to identify visually, and its use is discouraged. This mode is the default for many-to-many, copy, and generalization relationships and can't be changed for them.

draft

FK settings & Patterns​

This group of fields controls the settings for any foreign key generated by the relationships (deferral modes, update/delete modes). Also, in this group, the user can find the Index type (access mode) that is used to create an index on the relationship's generated foreign key columns. By default, all these attributes are used when creating new relationships, but they can be overridden by unchecking the Use global settings option in the relationship editing form.

This group of fields controls the name patterns for any object generated by relationships. These settings can also be overridden when creating new relationships by unchecking the Use global settings option in the relationship editing form.

ch4.relationships-settings1234567891011121314

Foreign key settings
#FieldDescription
1Deferrable

Makes the foreign keys generated by the relationships deferrable. These settings are used by the relationships that have the option Use global settings checked in the foreign key settings.

2Deferrable

Deferral mode of the generated foreign keys: INITIALLY IMMEDIATE or INITIALLY DEFERRED. It is available only when Deferrable is checked.

3Index type

Index access method used to create an index on the columns of the generated foreign keys. None creates no index.

4ON DELETE

Action applied to the referencing rows when a referenced row is deleted (ON DELETE) in the generated foreign keys. Default lets pgModeler choose the action according to the kind of relationship (see the section about relationships).

5ON UPDATE

Action applied to the referencing rows when a referenced row is updated (ON UPDATE) in the generated foreign keys. Default lets pgModeler choose the action (CASCADE).

Name patterns
#FieldDescription
6Relationship type

Relationship type whose name patterns are being edited. Each type keeps its own set of patterns.

7Column (source)

Pattern for columns generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n).

8Column (target)

Pattern for columns generated based upon target table's pk (n-n).

9Foreign key (source)

Pattern for foreign key generated based upon reference table's pk (1-1 and 1-n) or based upon source table's pk (n-n).

10Foreign key (target)

Pattern for foreign key generated based upon target table's pk (n-n).

11Primary key name

Pattern for primary key generated by identifier relationship.

12Primary key column

Pattern for primary key generated by identifier relationship.

13Unique key name

Pattern for unique key generated by the relationship.

14FK Index name

Pattern for foreign key indexes generated by the relationship.