ohmyapi/docs/migrations.md
Brian Wiborg 91baf968d7
📝 Add mkdocs
2025-10-02 01:01:57 +02:00

566 B

Migrations

OhMyAPI uses Aerich - a database migrations tool for TortoiseORM.

Making migrations

Whenever you add, remove or change fields of a database model, you need to create a migration for the change.

ohmyapi makemigrations [ <app> ]  # no app indicates all INSTALLED_APPS

This will create a migrations/ directory with subdirectories for each of your apps.

Migrating

When the migrations are create, they need to be applied:

ohmyapi migrate [ <app> ]  # no app indicates all INSTALLED_APPS