Skip to content

Commit 8205a62

Browse files
committed
📝 Fix include ranges
1 parent d1a5610 commit 8205a62

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/tutorial/create-db-and-table.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ So, we need to mark `id` as the **primary key**.
107107

108108
To do that, we use the special `Field` function from `sqlmodel` and set the argument `primary_key=True`:
109109

110-
{* ./docs_src/tutorial/create_db_and_table/tutorial001_py310.py ln[1:8] hl[1:5] *}
110+
{* ./docs_src/tutorial/create_db_and_table/tutorial001_py310.py ln[1:8] hl[1,5] *}
111111

112112
That way, we tell **SQLModel** that this `id` field/column is the primary key of the table.
113113

@@ -428,7 +428,7 @@ In this example it's just the `SQLModel.metadata.create_all(engine)`.
428428

429429
Let's put it in a function `create_db_and_tables()`:
430430

431-
{* ./docs_src/tutorial/create_db_and_table/tutorial002_py310.py ln[1:8] hl[17:18] *}
431+
{* ./docs_src/tutorial/create_db_and_table/tutorial002_py310.py ln[1:18] hl[17:18] *}
432432

433433
If `SQLModel.metadata.create_all(engine)` was not in a function and we tried to import something from this module (from this file) in another, it would try to create the database and table **every time** we executed that other file that imported this module.
434434

0 commit comments

Comments
 (0)