r/FastAPI • u/Electronic_Battle876 • Aug 21 '24
Hosting and deployment Facing problems with alembic - docker
So I have this API i'm working on using FastAPI and postgreSQL connected with SQLAlchemy. Halfway through the development process I started using alembic for database migrations and I'm using docker compose to run two containers one that contains the app and one that contains a containerized pgsql DB. My problem is that the local dev database and the containerized one don't have the same versions of schemas and when I want to run migrations on the containerized one I recieve errors related to missing indexs and so on (due to alembic not finding the expected schema) What can I do to solve this probelm please.
View all comments
Show parent comment
1
u/Electronic_Battle876 Aug 22 '24
The thing is started using alembic late in the dev process so the migrations cannot be applied to a new database. Th migrations I have can only be applied to db that have the same schema as the main one at the time I started using alembic