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
This commit is contained in:
parent
d4b0ceed9c
commit
11dd11a6ff
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user