Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions docs/create-diagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The following databases are supported:
- MSSQL
- Oracle

For the momment the import SQL diagram has not enable for Oracle Data Base.
For the moment the import SQL diagram has not been enabled for Oracle Data Base.

<ThemedImage
lightImageSrc={require("./img/light/pick-db.png").default}
Expand Down Expand Up @@ -93,25 +93,39 @@ You can define the following fields for an index:

## Relationships

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.
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.

<ThemedImage
lightImageSrc={require("./img/light/create-relationship.gif").default}
darkImageSrc={require("./img/dark/create-relationship.gif").default}
alt="Create a relationship"
/>

E.g. in the image above, since `posts.user_id` is the foreign key we start dragging from `user_id` to `users.id`.
The gif shows one of three possible notations selectable in the modeler; for each notation, the rendering and some actions may change.

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.
<!--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. -->!

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.

You can define the following fields for a relationship:

- Name
- Relationship type
- One to One
- One to Many
- Subtype
- Cardinality
- One to One
- One to Many
- Many to One
- Only available for One to one
- (0,1)
- (0,1)
- Only available for One to Many
- (0,*)
- (1,*)
- Subtype restriction (Only available for Subtype relations)
- Disjoint Total
- Disjoint Partial
- Overlaping Total
- Overlaping Partial
- On Delete Action
- On Update Action
- No action
Expand Down
Binary file modified docs/img/dark/create-relationship.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/dark/define-tables.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/dark/many-to-many.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/light/create-relationship.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/light/define-tables.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/img/light/many-to-many.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.