How to extend the DB schema?
For #42 the DB schema needs to be extended. How to do this in Sqlalchemy such that old DB files can still be loaded (and extended on the fly)?
Sqlalchemy does it automatically
Hm, I just added an average_heartrate column to the Activity class in db.py. Running the normal (non-reset) sync results in an exception sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such column: activities.average_heartrate...
-> Either I'm missing a required step, or DB migration is not done automatically...
But that's ok, since one could just use the --reset flag to regenerate the whole DB from scratch.
In fact, it requires to use Alembic :
https://alembic.sqlalchemy.org/en/latest/
I will take a look