Fix database migration error by adding project root to Python path in env.py
This commit is contained in:
parent
9e56bda916
commit
a2ec999501
@ -1,8 +1,14 @@
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from logging.config import fileConfig
|
||||
|
||||
from alembic import context
|
||||
from sqlalchemy import engine_from_config, pool
|
||||
|
||||
# Add project root to Python path
|
||||
project_root = Path(__file__).parent.parent
|
||||
sys.path.insert(0, str(project_root))
|
||||
|
||||
from app.db.base import Base
|
||||
|
||||
# this is the Alembic Config object, which provides
|
||||
|
Loading…
x
Reference in New Issue
Block a user