Skip to content

When using a multiple database setup, alembic does not detect added foreign keys #1443

Discussion options

You must be logged in to vote

Note that every time you return a falsy value from include_object that will be treated as "skip", same as returning False.

so you probably need a

if type_ == "foreign_key_constraint":
  return True

after your initial check, otherwise you exclude all of the new ones (that compare_to=None)

alternatively you may also consider return True at the end of your include object, otherwise you are excluding everything that's not matched by your conditions, so for example all indexes, unique, other constraints seem skipped by your include function

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
7 replies
@mmiller8878
Comment options

@zzzeek
Comment options

@mmiller8878
Comment options

@CaselIT
Comment options

@zzzeek
Comment options

Comment options

You must be logged in to vote
3 replies
@CaselIT
Comment options

Answer selected by mmiller8878
@mmiller8878
Comment options

@CaselIT
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants