Skip to content
Discussion options

You must be logged in to vote

step1: model is specific to a schema:

edit env.py here:

https://github.com/sqlalchemy/alembic/blob/main/alembic/templates/generic/env.py#L17-L21

set your model's MetaData there as described at https://alembic.sqlalchemy.org/en/latest/autogenerate.html#auto-generating-migrations

then, in your model, set the schema name for each model, or the overall MetaData, as documented at https://docs.sqlalchemy.org/en/20/core/metadata.html#specifying-the-schema-name , as well as additional ORM-specific notes at https://docs.sqlalchemy.org/en/20/orm/declarative_tables.html#orm-declarative-table-schema-name

step2: have autogenerate look in other schemas; see https://alembic.sqlalchemy.org/en/latest/auto…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@annndruha
Comment options

Answer selected by annndruha
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
Converted from issue

This discussion was converted from issue #1271 on July 13, 2023 20:23.