fix(database): migrations dir 경로 한 단계 잘못된 버그 수정

_run_migrations 가 Path(__file__).parent.parent.parent / "migrations" 로 계산했는데
/app/core/database.py 기준으로 parent.parent.parent = / (root) 가 되어
실제 경로는 /migrations 였음. 컨테이너 안에는 /app/migrations 에 마운트되므로
디렉토리 부재로 자동 스킵 → 추가 마이그레이션이 자동 적용되지 않는 dormant 버그.

parent.parent (= /app) 로 수정. 회귀 위험 0 (기존엔 어차피 동작 안 했음).
Phase 4 deploy 검증 중 발견 — 직전 commit 의 volume mount 와 함께 동작.
This commit is contained in:
Hyungi Ahn
2026-04-09 07:55:10 +09:00
parent d5f91556e6
commit dd9a0f600a

View File

@@ -95,7 +95,8 @@ async def _run_migrations(conn) -> None:
applied = {row[0] for row in result} applied = {row[0] for row in result}
# migration 파일 스캔 # migration 파일 스캔
migrations_dir = Path(__file__).resolve().parent.parent.parent / "migrations" # /app/core/database.py → parent.parent = /app → /app/migrations (volume mount 위치)
migrations_dir = Path(__file__).resolve().parent.parent / "migrations"
if not migrations_dir.is_dir(): if not migrations_dir.is_dir():
logger.info("[migration] migrations/ 디렉토리 없음, 스킵") logger.info("[migration] migrations/ 디렉토리 없음, 스킵")
return return