Best Practices for Source Controlled Migrations #1552
-
First Check
Commit to Help
Example Code
DescriptionIt is unclear how migrations are meant to be created and source-controlled in this project. The docs seem to suggest that the migration can be created in the container and that the migration file can be committed because of a volume mount
But looking at https://github.com/fastapi/full-stack-fastapi-template/blob/master/docker-compose.override.yml we see that it's a one way sync, not a volume mount. A hack around this could be a script to copy the alembic migrations from the container back to the host machine, and I'd be happy to write that script and make a PR if that direction makes sense. Operating SystemmacOS Operating System DetailsPretty standard Mac/Docker setup Python VersionPython 3.10.17 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
I just run it manually. Versioning is too much of a pain on this. I make sure to run all the commands from generate-client.sh one by one and that tells me if everything is setup correctly and then loads the Api into the frontend locally. If all goes well and it works i just migrate manually. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem, it seems the documentation was not updated since watch sync is indeed a one way sync from host to container acdording to docker compose official docs. |
Beta Was this translation helpful? Give feedback.
-
I'm having the same issue when I run this in the docker container |
Beta Was this translation helpful? Give feedback.
You are right, docs are incorrect now.
There is a PR #1431 that attempts to make it working