Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# NeuroBank FastAPI Toolkit

# Import models to ensure they are registered with SQLAlchemy metadata
# This must be done before database operations that use Base.metadata
from app import models # noqa: F401
3 changes: 0 additions & 3 deletions app/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ async def get_db() -> AsyncGenerator[AsyncSession, None]:

async def init_db() -> None:
"""Crea las tablas si no existen (útil para desarrollo y tests)."""
# Importación tardía para registrar modelos antes de create_all
from app import models # noqa: F401

async with engine.begin() as conn:
await conn.run_sync(Base.metadata.create_all)

Expand Down