Closed mbnoimi closed 1 year ago
This happens if you delete a revision as mentioned here: https://onebite.dev/solve-error-alembic-cant-locate-revision-identified-by-id_number/
This happens if you delete a revision as mentioned here: https://onebite.dev/solve-error-alembic-cant-locate-revision-identified-by-id_number/
Thank you @Stefan2409
I recreated all the containers from scratch (which will give me an empty database) but this issue still occurs.
BTW, I didn't delete any revision I only cloned this repository and create .env
as mentioned in README.md
Hello @mbnoimi that is because in my last commit I changed the model and add a new alembic revision. Also, each time you run docker-compose -f docker-compose-dev.yml exec fastapi_server alembic revision --autogenerate
Alembic generates a new revision on database.
The faster solution could be you delete db_docker folder from your root project folder and run the project again with the following commands.
docker-compose -f docker-compose-dev.yml up --build
docker-compose -f docker-compose-dev.yml exec fastapi_server python app/initial_data.py
I use recent commit 81983dc2927f7f9f417b723ff4bf4705c3426276