Fix alembic migration module import error by adding project root to Python path

generated with BackendIM... (backend.im)
This commit is contained in:
Automated Action 2025-05-14 07:23:20 +00:00
parent aeab17a8ea
commit 489906c063

View File

@ -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