My Alembic database migration is working in my dev environment using sqlAlchemy.
How do I apply this to my production environment?
My Alembic database migration is working in my dev environment using sqlAlchemy.
How do I apply this to my production environment?
First, initialize your alembric environment on prod so that it is identical to your dev environment. This includes your version files. This required some manual changes for my case.
Then, you just have to run:
alembic upgrade head
and it will bring your prod db up to your head revision. Best to first try:
alembic upgrade --sql head
to make sure it will do what you want and expect. I actually used the alembic stamp command to initialize the alembic state, but I don't think I needed to.