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
This commit is contained in:
Automated Action 2025-05-26 17:46:11 +00:00
parent 77865dae90
commit 6330360ba1

View File

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