diff --git a/api/init_db.py b/api/init_db.py index f1634da..7ec2f6d 100644 --- a/api/init_db.py +++ b/api/init_db.py @@ -3,6 +3,16 @@ from sqlmodel import Session, SQLModel, create_engine from sqlmodel.ext.asyncio import session +import sys +from pathlib import Path + +# Get the absolute path of the directory containing this script +current_file = Path(__file__).resolve() +parent_directory = current_file.parent +project_directory = parent_directory.parent + +sys.path.insert(0, str(project_directory)) + from api.database import create_db_and_tables, create_town_and_people, get_db