your env.py script makes all the determinations as to when the migrations
run and on what database connection. For a small number of databases, I will
often place different sections within alembic.ini and run alembic upgrade
passing the —name argument:
[customer_one]
sqlalchemy.url = driver://user:pass@localhost/dbname
[customer_two]
sqlalchemy.url = driver://user:pass@localhost/dbname
alembic upgrade head —name customer_one
if you want to do something more dynamic you can call upon
run_migrations_online() multiple times within the env.py script, see the
example in the “multidb” template. run_migrations_online() runs whatever the
current command is from the outside, it’s passed in as a function.
>
> Thank you
>
> --
> You received this message because you are subscribed to the Google Groups "sqlalchemy-alembic" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
sqlalchemy-alem...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.