Alembic support for multiple Postgres schemas

前端 未结 3 1851
我寻月下人不归
我寻月下人不归 2020-12-15 06:25

How can I use Alembic\'s --autogenerate to migrate multiple Postgres schemas that are not hard-coded in the SQL Alchemy model? (mirror question of SQLA

3条回答
  •  余生分开走
    2020-12-15 07:05

    Here's a workable solution: https://gist.github.com/nickretallack/bb8ca0e37829b4722dd1

    It still requires you to edit the schema name out of each migration after it's generated, but at least the interesting work is done by Alembic. Thanks to Michael Bayer for help with this on the mailing list.

提交回复
热议问题