Fix container not starting if data dir did not exist
This commit is contained in:
@@ -79,8 +79,12 @@ def seed_db() -> None:
|
||||
|
||||
|
||||
def init_db():
|
||||
logger.info("Initializing database...")
|
||||
if Path(DB_PATH).exists():
|
||||
return
|
||||
logger.info("Database does not exist, creating...")
|
||||
if not Path(DB_PATH).parent.exists():
|
||||
Path(DB_PATH).parent.mkdir(parents=True, exist_ok=True)
|
||||
with open(SQL_PATH, "r") as f:
|
||||
sql = f.read()
|
||||
with get_connection() as conn:
|
||||
|
||||
Reference in New Issue
Block a user