Skip to content

Commit d94fdb8

Browse files
committed
Fix SQLAlchemy class lookup
1d30172e7a76e3b78d2cdcb5289a3c986aa71264
1 parent 7dfac18 commit d94fdb8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

backend/app/app/db/init_db.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
from app.core import config
33
from app.models.user import UserCreate
44

5+
# make sure all SQL Alchemy models are imported before initializing DB
6+
# otherwise, SQL Alchemy might fail to initialize properly relationships
7+
# for more details: https://github.com/tiangolo/full-stack-fastapi-postgresql/issues/28
8+
from app.db import base
59

610
def init_db(db_session):
711
# Tables should be created with Alembic migrations

0 commit comments

Comments
 (0)