Unexpected behavior postgis migration on fastAPI #1605
Replies: 2 comments
-
what the error message and the missing create table do not seem to be related. I can't see what would cause the error message since your non-working migration has nothing about a for the missing "create table", you'd want to make sure your models are correctly integrated with your env.py by using the Overall it's difficult to say what's happening here without a clear view of the database beforehand and full logging output. |
Beta Was this translation helpful? Give feedback.
-
Ensure that your Models Are Imported in Alembic's |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
My database is postgis/postgis:16-3.4 on linux/amd64. I am trying to generate a table called Village and the autogenerate of the alembic version from my model is not acting as expected. This is my model:
when i am doing this :
docker-compose run --rm backend alembic revision --autogenerate -m "create village table"
, I have a new version that is created:and when doing my
docker-compose run --rm backend alembic upgrade head
, I am getting this error:Expected behavior
I found that If I modify the create_village_table.py file with this code, manually its working:
Versions.
Beta Was this translation helpful? Give feedback.
All reactions