📝 Add more info on migrations

This commit is contained in:
Brian Wiborg 2025-09-27 05:00:58 +02:00
parent 898ab6de99
commit 8d9264e8db
No known key found for this signature in database

View file

@ -116,7 +116,21 @@ Similar to Django, first run:
ohmyapi makemigrations [ <app> ] # no app means all INSTALLED_APPS ohmyapi makemigrations [ <app> ] # no app means all INSTALLED_APPS
``` ```
And the apply your migrations via: This will create a `migrations/` folder in you project root.
```
myproject/
- myapp/
- __init__.py
- models.py
- routes.py
- migrations/
- myapp/
- pyproject.toml
- settings.py
```
Apply your migrations via:
``` ```
ohmyapi migrate [ <app> ] # no app means all INSTALLED_APPS ohmyapi migrate [ <app> ] # no app means all INSTALLED_APPS
@ -139,6 +153,7 @@ ohmyapi shell
## Authentication ## Authentication
A builtin auth app is available. A builtin auth app is available.
Simply add `ohmyapi_auth` to your INSTALLED_APPS and define a JWT_SECRET in your `settings.py`. Simply add `ohmyapi_auth` to your INSTALLED_APPS and define a JWT_SECRET in your `settings.py`.
Remember to `makemigrations` and `migrate` for the auth tables to be created in the database. Remember to `makemigrations` and `migrate` for the auth tables to be created in the database.