From dd9a0f600a9599ed1b14f9b125ff05d0c066c70f Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Thu, 9 Apr 2026 07:55:10 +0900 Subject: [PATCH] =?UTF-8?q?fix(database):=20migrations=20dir=20=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=ED=95=9C=20=EB=8B=A8=EA=B3=84=20=EC=9E=98=EB=AA=BB?= =?UTF-8?q?=EB=90=9C=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _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 와 함께 동작. --- app/core/database.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/core/database.py b/app/core/database.py index f4fef53..30b4432 100644 --- a/app/core/database.py +++ b/app/core/database.py @@ -95,7 +95,8 @@ async def _run_migrations(conn) -> None: applied = {row[0] for row in result} # 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(): logger.info("[migration] migrations/ 디렉토리 없음, 스킵") return