fix(models,db): delegate timestamps to DB server and configure connection pool

- Replace default=datetime.utcnow with server_default=func.now() across all 16 models (17 columns) for consistent, timezone-aware timestamps from PostgreSQL

- Upgrade DateTime columns to DateTime(timezone=True) for timestamptz storage

- Configure SQLAlchemy engine pool: pool_size=20, max_overflow=10, pool_recycle=3600, pool_pre_ping=True

- Remove unused datetime imports from model files
This commit is contained in:
2026-02-18 11:52:15 +01:00
parent a4a2adccee
commit 51c927394d
18 changed files with 42 additions and 70 deletions

View File

@@ -14,7 +14,13 @@ def _get_engine():
global _engine
if _engine is None:
from app.config import settings
_engine = create_engine(settings.DATABASE_URL)
_engine = create_engine(
settings.DATABASE_URL,
pool_size=20,
max_overflow=10,
pool_recycle=3600,
pool_pre_ping=True,
)
return _engine