From 11dd11a6ffe056fa490d51558959cb52c0537025 Mon Sep 17 00:00:00 2001 From: Automated Action Date: Sun, 8 Jun 2025 18:16:20 +0000 Subject: [PATCH] Fix database migration import path error - Add project root to Python path in migrations/env.py - Ensure all models are properly imported in base_models.py - Fix import statements for proper module resolution --- migrations/env.py | 6 ++++++ 1 file changed, 6 insertions(+) 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