|
1 년 전 | |
---|---|---|
.. | ||
001_initial_schema.py | 1 년 전 | |
002_add_local_sharing.py | 1 년 전 | |
README.md | 1 년 전 |
This directory contains all the database migrations for the web app.
Migrations are done using the peewee-migrate
library.
Migrations are automatically ran at app startup.
Have you made a change to the schema of an existing model? You will need to create a migration file to ensure that existing databases are updated for backwards compatibility.
webui.db
) that has the old schema prior to any of your changes.From the backend
directory, run the following command:
pw_migrate create --auto --auto-source apps.web.models --database sqlite:///${SQLITE_DB} --directory apps/web/internal/migrations ${MIGRATION_NAME}
$SQLITE_DB
should be the path to the database file.$MIGRATION_NAME
should be a descriptive name for the migration.The migration file will be created in the apps/web/internal/migrations
directory.