fix: import models in init_db to ensure table creation

This commit is contained in:
Ricel Leite 2026-02-18 22:49:20 -03:00
parent 3b727a8ee2
commit c812147c40
1 changed files with 3 additions and 0 deletions

View File

@ -23,5 +23,8 @@ async def get_db() -> AsyncSession:
await session.close() await session.close()
async def init_db(): async def init_db():
# Import all models here to ensure they are registered with Base.metadata
from app.models import User, Organization, OrganizationMember, Integration, Issue, AuditLog # noqa
async with engine.begin() as conn: async with engine.begin() as conn:
await conn.run_sync(Base.metadata.create_all) await conn.run_sync(Base.metadata.create_all)