How does alembic generate the version hash for Jupyterhub?

Hi all, I would like to update my database for jupyterhub (I changed the default structure and added an additional column) but the update won’t take place because it seems that the alembic version was not changed.
I would appreciate it if anyone could tell me how the version hash for the database is generated and which would be the most efficient way to upgrade the database. (Writing a new sqlite file solves the problem, but I prefer not losing all the information from the old database). Thank you and any tips are welcome!

They are generated by running alembic revision --autogenerate to start. You can run in a dev install of jupyterhub

python -m jupyterhub.dbutil alembic revision --autogenerate -m "short description"

which will create a file in jupyterhub/alembic/versions which you can edit to implement the upgrade/downgrade logic.

1 Like