mirror of
https://github.com/kevin-DL/full-stack-fastapi-postgresql.git
synced 2026-01-12 18:25:15 +00:00
🗃️ Fix SQLAlchemy class lookup (#29)
This commit is contained in:
@@ -2,6 +2,11 @@ from app import crud
|
||||
from app.core import config
|
||||
from app.models.user import UserCreate
|
||||
|
||||
# make sure all SQL Alchemy models are imported before initializing DB
|
||||
# otherwise, SQL Alchemy might fail to initialize properly relationships
|
||||
# for more details: https://github.com/tiangolo/full-stack-fastapi-postgresql/issues/28
|
||||
from app.db import base
|
||||
|
||||
|
||||
def init_db(db_session):
|
||||
# Tables should be created with Alembic migrations
|
||||
|
||||
Reference in New Issue
Block a user