diff --git a/docs/docs/relationships.md b/docs/docs/relationships.md
index de78e59..0a9bdfa 100644
--- a/docs/docs/relationships.md
+++ b/docs/docs/relationships.md
@@ -44,6 +44,8 @@ This type of relationship is used when only a single model is related. In our ch
### Direct
+![Direct one relation diagram](/relationships/one-direct.svg)
+
The direct one relationship uses a local foreign key to get the related model. In other libraries, this type of relationship can be referred as "belongs to". It has two parameters:
- **mandatory** `foreignKey`: name of the field / column where the related model key is stored.
@@ -61,6 +63,8 @@ const MessageRelationships = MessageRepository.relationships.define(.{
### Reverse
+![Reverse one relation diagram](/relationships/one-reverse.svg)
+
The reverse one relationship uses a distant foreign key to get the related model. It can be used to get related models when they hold a foreign key to the origin model. In other libraries, this type of relationship can be referred as "has one". It has two parameters:
- _optional_ `foreignKey`: name of the field / column where the related model key is stored. When none is provided, the default related model key name is used.
@@ -78,6 +82,8 @@ const UserRelationships = UserRepository.relationships.define(.{
### Through
+![Through one relation diagram](/relationships/one-through.svg)
+
The through one relationship uses a pivot table to get the related model. It can be used to get related models when the foreign key is hold by an intermediate table. In other libraries, this type of relationship can be referred as "has one through". It has five parameters:
- **mandatory** `table`: name of the pivot / intermediate / join table.
@@ -111,6 +117,8 @@ This type of relationship is used when only a many models are related. In our ch
### Direct
+![Direct many relation diagram](/relationships/many-direct.svg)
+
The direct many relationship uses a distant foreign key to get related models. It's often used at the opposite side of a direct one relationship. In other libraries, this type of relationship can be referred as "has many". It has two parameters:
- **mandatory** `foreignKey`: name of the field / column where the origin model key is stored.
@@ -128,6 +136,8 @@ const UserRelationships = UserRepository.relationships.define(.{
### Through
+![Through many relation diagram](/relationships/many-through.svg)
+
The through many relationship uses a pivot table to get the related models. It can be used to get related models when the foreign key is hold by an intermediate table. In other libraries, this type of relationship can be referred as "belongs to many". It has five parameters:
- **mandatory** `table`: name of the pivot / intermediate / join table.
diff --git a/docs/public/relationships/many-direct.svg b/docs/public/relationships/many-direct.svg
new file mode 100644
index 0000000..8473cda
--- /dev/null
+++ b/docs/public/relationships/many-direct.svg
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/docs/public/relationships/many-through.svg b/docs/public/relationships/many-through.svg
new file mode 100644
index 0000000..ff65c7a
--- /dev/null
+++ b/docs/public/relationships/many-through.svg
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/docs/public/relationships/one-direct.svg b/docs/public/relationships/one-direct.svg
new file mode 100644
index 0000000..f410dce
--- /dev/null
+++ b/docs/public/relationships/one-direct.svg
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/docs/public/relationships/one-reverse.svg b/docs/public/relationships/one-reverse.svg
new file mode 100644
index 0000000..81bb690
--- /dev/null
+++ b/docs/public/relationships/one-reverse.svg
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/docs/public/relationships/one-through.svg b/docs/public/relationships/one-through.svg
new file mode 100644
index 0000000..2fbd619
--- /dev/null
+++ b/docs/public/relationships/one-through.svg
@@ -0,0 +1,10 @@
+
\ No newline at end of file