Use default behaviour inside include_object hook #1599
-
I'm currently trying to add some custom configuration to the My problem is that I want to add some detection for things that aren't handled by default, but not deal with all cases. If I perform my logic for include/exclude then arbitrarily return True then almost every column turns up in the migrations and similarly if I return False then it excludes changes that otherwise would've been detected by default. When I added some logic to the Ideally I'm looking for a way for my code to do something like this: def my_include_object(object, name, type_, reflected, compare_to):
if (my custom logic condition to include the object):
return True
else:
# Do the generic implementation of include_object
def run_migrations_online() -> None:
context.configure(
include_object=my_include_object
) Thanks for any help/suggestions! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
the return value of if the columns are turning up in migrations that would mean alembic sees something different about them. To solve your problem we would need to know what it is you are actually trying to achieve, such as, what are these "things that arent handled by default". that sounds like a bigger problem |
Beta Was this translation helpful? Give feedback.
the return value of
True
is the default.include_object
is used for omitting things from autogenerate that normally would be considered for changes.if the columns are turning up in migrations that would mean alembic sees something different about them.
To solve your problem we would need to know what it is you are actually trying to achieve, such as, what are these "things that arent handled by default". that sounds like a bigger problem