| Table | Rows | Size |
|---|---|---|
flights |
10 | 48 kB |
tm_files |
2 | 48 kB |
fetched_files |
0 | 40 kB |
instruments |
10 | 40 kB |
subsystems |
6 | 40 kB |
variables |
113 | 40 kB |
alembic_version |
1 | 24 kB |
instrument_subsystems |
22 | 24 kB |
After modifying a model in postgres/models.py, generate and apply the migration on your development system:
podman exec kalcloud-flask flask --app app db migrate -m "describe change" podman exec kalcloud-flask flask --app app db upgrade
db migrate generates a versioned migration script in flask/migrations/versions/.
This only needs to be run once on the development system — commit the resulting script to git.
On each operational system (e.g. kalcloud), pull the latest code and run only db upgrade
to apply the pending migration:
git pull podman exec kalcloud-flask flask --app app db upgrade
Other useful commands:
podman exec kalcloud-flask flask --app app db current # current migration version podman exec kalcloud-flask flask --app app db history # migration history podman exec kalcloud-flask flask --app app db downgrade # roll back one version