Skip to content

Auto-migrating specific tables I define and ignoring all others? #1007

Discussion options

You must be logged in to vote

the "Type" being viewed should be "schema", not "table":

def include_name(name, type_, parent_names):
    if type_ == "schema":
        return name in ["schema_one", "schema_two"]
    else:
        return True

context.configure(
    # ...
    include_schemas = True,
    include_name = include_name
)

https://alembic.sqlalchemy.org/en/latest/api/runtime.html?highlight=include_name#alembic.runtime.environment.EnvironmentContext.configure.params.include_name

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fazal-kh4n
Comment options

Answer selected by fazal-kh4n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants