Re: Run alembic upgrade header inside a python function

2015-01-05 Thread Dorian Hoxha
Thanks Michael, What I ended up doing is, in the end of env.py: for c in get_clients(): # generate metadata for this client # generate engine for this client if context.is_offline_mode(): run_migrations_offline(metadata) else: run_migrations_online(metadata, engi

Re: Run alembic upgrade header inside a python function

2015-01-05 Thread Michael Bayer
Dorian Hoxha wrote: > Hi list(), > > I'm currently using 1 db / customer. That means in development I test the > migration with 1 db and on production I want to run the 'upgrade' command on > each database. > > So I just want something like: > > def upgrade(connection details or metadata,

Run alembic upgrade header inside a python function

2015-01-05 Thread Dorian Hoxha
Hi list(), I'm currently using 1 db / customer. That means in development I test the migration with 1 db and on production I want to run the 'upgrade' command on each database. So I just want something like: def upgrade(connection details or metadata, or metadata + engine) I looked at the e