Fix database migration import path issue
Updated migrations/env.py to import Base from app.database.session instead of app.models, fixing the 'cannot import name Base' error.
This commit is contained in:
parent
7cbef584c0
commit
783583b234
@ -25,7 +25,9 @@ for container_path in container_paths:
|
|||||||
# Now we can import our application modules
|
# Now we can import our application modules
|
||||||
try:
|
try:
|
||||||
from app.core.config import settings # noqa: F401 - Used in later operations
|
from app.core.config import settings # noqa: F401 - Used in later operations
|
||||||
from app.models import Base
|
|
||||||
|
# Import Base from database.session where it's defined
|
||||||
|
from app.database.session import Base
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
print(f"Error importing app modules: {e}")
|
print(f"Error importing app modules: {e}")
|
||||||
print(f"Current sys.path: {sys.path}")
|
print(f"Current sys.path: {sys.path}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user