This document is intended to developers.
Migrations on Tracim lays on alembic which is the migration tool dedicated to SQLAlchemy.
In order to use the alembic commands, change your current directory to be tracim/ from the root of the project, also usually named tracim/
and active the Tracim virtualenv:
user@host:~/tracim_backend$ cd tracim/
user@host:~/tracim_backend/tracim$ source env/bin/activate
(env) user@host:~/tracim_backend/tracim$
alembic -c development.ini upgrade head
alembic -c development.ini downgrade -1
alembic -c development.ini current
This creates a new auto-generated python migration file
in tracim/migration/versions/ ending by migration_label.py:
alembic -c development.ini revision --autogenerate -m "migration label"