Skip to content

Commit

Permalink
Moved images, fixed links, renamed folders (prisma#1959)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhwelander authored Jul 1, 2021
1 parent 856b7a5 commit 6889137
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ At a Prisma level, a connection between two models is **always** represented by

The following entity relationship diagram defines the same one-to-many relation between the `User` and `Post` tables in a database:

![A 1-n relationship between a user and posts table.(../relations/one-to-many.png)
![A 1-n relationship between a user and posts table](one-to-many.png)

In SQL, you use a _foreign key_ to create a relation between two tables. Foreign keys are stored on **one side** of the relation. Our example is made up of:

Expand Down Expand Up @@ -155,7 +155,7 @@ model Category {
The following entity relationship diagram represents the database that corresponds to the sample Prisma schema:
![The sample schema as an entity relationship diagram(../relations/sample-schema.png)
![The sample schema as an entity relationship diagram](sample-schema.png)
## Terminology
Expand Down Expand Up @@ -744,7 +744,7 @@ CREATE UNIQUE INDEX "_CategoryToPost_AB_unique" ON "_CategoryToPost"("A" int4_op
CREATE INDEX "_CategoryToPost_B_index" ON "_CategoryToPost"("B" int4_ops);
```
![Many-to-many relations(../https://imgur.com/DQClFIX.png)
![Many-to-many relations](https://imgur.com/DQClFIX.png)
An _explicit_ variant of a similar m-n-relation would define an extra model to represent a relation table. In this case, you can also attach additional information to the relation (such as the point in time when it was created):
Expand Down Expand Up @@ -792,7 +792,7 @@ CREATE TABLE "CategoryToPost" (
CREATE UNIQUE INDEX "CategoryToPost_category_post_unique" ON "CategoryToPost"("categoryId" int4_ops,"postId" int4_ops);
```
![M-N Relation between Post and Category(../https://imgur.com/JQ22x60.png)
![M-N Relation between Post and Category](https://imgur.com/JQ22x60.png)
### Conventions for relation tables in implicit m-n-relations
Expand Down

0 comments on commit 6889137

Please sign in to comment.