You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -93,25 +93,39 @@ You can define the following fields for an index:
93
93
94
94
## Relationships
95
95
96
-
To create relationships and define foreign keys, click and hold the blue dot on the foreign key column, then drag and drop it onto the primary column. This action follows the logic of `start_col REFERENCES end_col`, where the column you drag from will be designated as the foreign key, linking it to the primary key in the destination column.
96
+
To create a relationship and define foreign keys, click and hold the blue dot on the primary key and drag it to the table with which you want to form the relationship. This will cause a new row to be automatically generated in the child table that will have the primary key information.
E.g. in the image above, since `posts.user_id` is the foreign key we start dragging from `user_id` to `users.id`.
104
+
The gif shows one of three possible notations selectable in the modeler; for each notation, the rendering and some actions may change.
105
105
106
-
If at some point you realize that the keys are flipped you can swap them from the `Relationships` tab. Open the relationship you'd like to edit, click on the more button (three dots) next to the primary and forign columns, and then swap.
106
+
<!--If at some point you realize that the keys are flipped you can swap them from the `Relationships` tab. Open the relationship you'd like to edit, click on the more button (three dots) next to the primary and forign columns, and then swap. -->!
107
+
108
+
To delete the relationship, simply double-click on the relationship and select the delete button or delete the auto-generated foreign key from the table.
107
109
108
110
You can define the following fields for a relationship:
109
111
110
112
- Name
113
+
- Relationship type
114
+
- One to One
115
+
- One to Many
116
+
- Subtype
111
117
- Cardinality
112
-
- One to One
113
-
- One to Many
114
-
- Many to One
118
+
- Only available for One to one
119
+
- (0,1)
120
+
- (0,1)
121
+
- Only available for One to Many
122
+
- (0,*)
123
+
- (1,*)
124
+
- Subtype restriction (Only available for Subtype relations)
0 commit comments