From 489906c063246bf936b1b825da20c99bc5c53f4b Mon Sep 17 00:00:00 2001 From: Automated Action Date: Wed, 14 May 2025 07:23:20 +0000 Subject: [PATCH] Fix alembic migration module import error by adding project root to Python path generated with BackendIM... (backend.im) --- alembic/env.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/alembic/env.py b/alembic/env.py index 6e2d66a..16abc88 100644 --- a/alembic/env.py +++ b/alembic/env.py @@ -1,10 +1,15 @@ from logging.config import fileConfig +import os +import sys from sqlalchemy import engine_from_config from sqlalchemy import pool from alembic import context +# Add the parent directory to the Python path +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) + # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config