Auto-migrating specific tables I define and ignoring all others? #1007
-
Hi, I am working on a large project, which has several tables. I want to ensure that all alembic actions, especially auto-migrations, are scoped to the tables I am working on. To this end, I have edited my
However, when I run the command:
It produces version file that has operations on all the schemas that I do not want to deal with. Have I misunderstood something? I just want to scope alembic to only deal with tables I care about and tell it to. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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
) |
Beta Was this translation helpful? Give feedback.
the "Type" being viewed should be "schema", not "table":
https://alembic.sqlalchemy.org/en/latest/api/runtime.html?highlight=include_name#alembic.runtime.environment.EnvironmentContext.configure.params.include_name