diff --git a/migrations/env.py b/migrations/env.py index 92dafe4..6d0d587 100644 --- a/migrations/env.py +++ b/migrations/env.py @@ -1,8 +1,14 @@ +import sys from logging.config import fileConfig +from pathlib import Path from alembic import context from sqlalchemy import engine_from_config, pool +# Add the project root directory to the Python path +# This ensures that the 'app' module can be imported correctly +sys.path.insert(0, str(Path(__file__).parent.parent)) + # Import all models for Alembic to detect # Import Base from our app for auto-generating migrations from app.db.base import Base