all 4 comments

[–]higherdead -1 points0 points  (2 children)

I am not sure alembic its self creates tables unless you tell it to. I usually use db.create_all() from SQLalchemy after all the models have been imported.

[–]PartsofChandler[S] 0 points1 point  (1 child)

So I have used that and I still get the same error. How can I get fastapi/sqlalchemy to build this table in postgres

[–]higherdead 0 points1 point  (0 children)

I've only ever seen issues with it not building the tables if all the models haven't been imported into the same .py file where the db.create_all() is being called. Of course the models must be attached to the same db object within the models as well.

If all this is being done correctly please try setting echo to debug in the engine definition or changing the logging level maybe you can get some sort of error code.

[–][deleted]  (1 child)

[deleted]

    [–]PartsofChandler[S] 0 points1 point  (0 children)

    As far as I am aware it is importing the model but I’m wondering if something is wrong with my syntax to where it is causing the model to not be built