How to make alembic autogenerate names for foreign_keys? #1024
Unanswered
maham360
asked this question in
Usage Questions
Replies: 1 comment 32 replies
-
the naming convention needs to be inside the MetaData object that your model is built on, this one:
so wherever Flask sets up the "db.metadata", that's where you set up that naming convention. here's a stackoverflow example https://stackoverflow.com/a/29153957/34549 |
Beta Was this translation helpful? Give feedback.
32 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my migration file I have alembic bringing up alterations such as:
I am trying to incorporate this code into my env.py file in order to make alembic name foreign keys automatically, but I'm not sure how to incorporate this into my code.
So far I have it existing in my env.py file like this, but after I run a new migration nothing changes:
I'm using flask sqlalchemy. Can someone help me get this to work? Or have any better solutions? Thanks
Beta Was this translation helpful? Give feedback.
All reactions