From b49326147f6bdab8dcb00bb2cef3f0466644edfd Mon Sep 17 00:00:00 2001 From: jlightner Date: Mon, 30 Mar 2026 01:22:30 +0000 Subject: [PATCH] fix: alembic env.py sys.path includes parent dir for Docker compatibility --- alembic/env.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/alembic/env.py b/alembic/env.py index da9a782..d9bc0f3 100644 --- a/alembic/env.py +++ b/alembic/env.py @@ -10,7 +10,10 @@ from sqlalchemy import pool from sqlalchemy.ext.asyncio import async_engine_from_config # Ensure the backend package is importable +# When running locally: alembic/ sits beside backend/, so ../backend works +# When running in Docker: alembic/ is inside /app/ alongside the backend modules sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "backend")) +sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) from database import Base # noqa: E402 import models # noqa: E402, F401 — registers all tables on Base.metadata