Deadlock while migrating the same set of revisions for multiple schemas in postgreSQL #525
Unanswered
jay-patel-simformsolutions
asked this question in
Q&A
Replies: 1 comment
-
I think this question should be directed at the Alembic team. Flask-Migrate is just a wrapper that integrates Alembic into Flask. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My requirement is that I have a series of migrations and I apply the same set of migrations on multiple database schemas (a typical multitenant requirement). I have updated my env.py file to do this customer behavior in this way
This works perfectly fine when I run the command
python -m flask db upgrade
but when the flask server is running and I want to upgrade the database migrations when a new customer is added, so I do a flask migrate in the API call as bellowIn this process everything works fine until there are 2 revisions lets say revision1 and revision2 and in revision1 we are creating a constraint
revision1.py
and drop that in revision2
revision2.py
when I try to apply these revisions from the API it goes into deadlock but works correctly when triggered via cli with
flask db upgrade
. Need some help in understanding and solving it.Beta Was this translation helpful? Give feedback.
All reactions