Skip to content

Commit 9b58d73

Browse files
committed
🎨 update: add spacing for clarity in migration documentation
1 parent 5cb04c1 commit 9b58d73

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/advanced/migrations.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ Then go to `migrations\env.py` to finish the alembic configuration.
122122
```
123123

124124
/// warning
125+
125126
First import your models and then import SQLModel otherwise sqlmodel doesn´t recognize all models.
126127

127128
///
@@ -137,7 +138,9 @@ Then go to `migrations\env.py` to finish the alembic configuration.
137138
```
138139

139140
/// tip
141+
140142
This step can be replaced setting the same `sqlalchemy.url` variable in `alembic.ini` file.
143+
141144
///
142145

143146
- Finally set `target_metadata` with your `SQLModel.metada`
@@ -179,6 +182,7 @@ Generating migrations\versions\34abfb7ac266_init_db.py ... done
179182
Now in `versions` folder we have a new file called `34abfb7ac266_init_db.py`
180183

181184
/// info
185+
182186
This file has a revision id and the message part from our revision command.
183187

184188
///
@@ -190,6 +194,7 @@ Now in `versions` folder we have a new file called `34abfb7ac266_init_db.py`
190194
{!./docs_src/advanced/migrations/annotations/en/tutorial005.md!}
191195

192196
/// success
197+
193198
At this moment we have all the files to create our new database model.
194199

195200
///
@@ -295,6 +300,7 @@ The new file `b39b8d3c77f0_new_field_power.py`:
295300
{!./docs_src/advanced/migrations/annotations/en/tutorial007.md!}
296301

297302
/// note
303+
298304
Run `alembic upgrade head` to add the new field named power
299305

300306
///
@@ -312,6 +318,7 @@ INFO [alembic.runtime.migration] Running upgrade 357d6ebcfadf -> b39b8d3c77f0,
312318
</div>
313319

314320
/// note
321+
315322
After you can downgrade the database to the previous version, run `alembic downgrade -1`
316323

317324
///
@@ -329,6 +336,7 @@ INFO [alembic.runtime.migration] Running downgrade b39b8d3c77f0 -> 357d6ebcfadf
329336
</div>
330337

331338
/// success
339+
332340
Migrations complete!!! Try adding new tables and relationship.
333341

334342
///

0 commit comments

Comments
 (0)