spiral-project/ihatemoney — Issue #83: Handle db migration?
Author: feth
Created: 2012-03-08 07:41:07+00:00
State: open

Hello,

I'd like to try and add a feature to this app, that requires an sql schema migration.
Do you have an opinion about the best way to properly handle schema migrations?

Basically, all tools work the same and rely on a version field (integer) stored in a special table.
If not found, table and field are created (and version assumed to be 0).
If found, application compares the field with its own schema version, and if necessary, applies required migrations.

SqlAlchemy has its own tool: http://readthedocs.org/docs/sqlalchemy-migrate
They describe the generic steps involved: http://caneypuggies.alwaysreformed.com/wiki/DevelopingWithMigrations

Googling for "flask migration", I also found https://github.com/adamrt/flask-evolution/tree/master/flaskext -however I'm not sure what it is good for.