mirror of
https://github.com/fastapi/sqlmodel.git
synced 2026-01-06 01:19:50 -06:00
🍱 Update SVG files, a single file per diagram, sans-serif fonts (#1373)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
cd19d606ab
commit
e7b970cfa8
@@ -4,7 +4,7 @@ Let's continue from where we left and create some data.
|
||||
|
||||
We'll create data for this same **many-to-many** relationship with a link table:
|
||||
|
||||
<img alt="many-to-many table relationships" src="/img/tutorial/many-to-many/many-to-many.svg">
|
||||
<img alt="many-to-many table relationships" src="/img/tutorial/many-to-many/many-to-many.drawio.svg">
|
||||
|
||||
We'll continue from where we left off with the previous code.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
We'll now support **many-to-many** relationships using a **link table** like this:
|
||||
|
||||
<img alt="many-to-many table relationships" src="/img/tutorial/many-to-many/many-to-many.svg">
|
||||
<img alt="many-to-many table relationships" src="/img/tutorial/many-to-many/many-to-many.drawio.svg">
|
||||
|
||||
Let's start by defining the class models, including the **link table** model.
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ We have a column in the `hero` table for the `team_id` that points to the ID of
|
||||
|
||||
This is how we connect each `hero` with a `team`:
|
||||
|
||||
<img alt="table relationships" src="/img/databases/relationships.svg">
|
||||
<img alt="table relationships" src="/img/databases/relationships.drawio.svg">
|
||||
|
||||
Notice that each hero can only have **one** connection. But each team can receive **many** connections. In particular, the team **Preventers** has two heroes.
|
||||
|
||||
@@ -83,7 +83,7 @@ As this will represent the **hero-team-link**, let's call the table `heroteamlin
|
||||
|
||||
It would look like this:
|
||||
|
||||
<img alt="many-to-many table relationships" src="/img/tutorial/many-to-many/many-to-many.svg">
|
||||
<img alt="many-to-many table relationships" src="/img/tutorial/many-to-many/many-to-many.drawio.svg">
|
||||
|
||||
Notice that now the table `hero` **doesn't have a `team_id`** column anymore, it is replaced by this link table.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user