From 6330360ba1d5dd885a7c444a4fb01e8a716a0fb5 Mon Sep 17 00:00:00 2001 From: Automated Action Date: Mon, 26 May 2025 17:46:11 +0000 Subject: [PATCH] Fix alembic migration Python path issue in env.py - Added sys.path modification to ensure app module can be found - Fixed imports to follow proper order - Removed unused os import --- migrations/env.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/migrations/env.py b/migrations/env.py index 84e5496..100490f 100644 --- a/migrations/env.py +++ b/migrations/env.py @@ -1,9 +1,16 @@ from logging.config import fileConfig +import sys +from pathlib import Path from sqlalchemy import engine_from_config from sqlalchemy import pool from alembic import context + +# This line adds the project root to the Python path +sys.path.insert(0, str(Path(__file__).parent.parent.absolute())) + +# Import after setting up the path from app.db.session import Base # this is the Alembic Config object, which provides