Repository navigation
How do I do a migration if my backend container won't start due to an error? #1345
Answered
by
YuriiMotov
tharrington
asked this question in
Questions
First Check
Commit to Help
Example CodeDescriptionI have an error that was caused by some model code. I have updated the models and I want to create a new migration, but the following command fails: Looking at the logs, it's clear this is caused by my model not having a relationship done properly. Operating SystemmacOS Operating System DetailsMac M1 Python Version3.11.2 Additional ContextNo response |
Answered by
YuriiMotov
Sep 5, 2025
Replies: 2 comments
|
see here on how to apply migrations |
0 replies
|
In and uncomment the line above Then run You are inside the backend container and can run alembic commands |
0 replies
Answer selected by
YuriiMotov
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
docker-compose.override.ymlcomment out the following linesand uncomment the line above
Then run
docker compose watchand in new terminal, attach to the container withdocker compose exec backend bash.Now you can see something like
You are inside the backend container and can run alembic commands
Docs: https://github.com/fastapi/full-stack-fastapi-template/blob/master/backend/README.md#docker-compose-override