From d51e8665050d47e532246b28099c57834f6015cb Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 7 Jul 2024 09:09:09 -0700 Subject: [PATCH] fix: db --- backend/apps/webui/internal/db.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/apps/webui/internal/db.py b/backend/apps/webui/internal/db.py index 8437ae4fa..aed110254 100644 --- a/backend/apps/webui/internal/db.py +++ b/backend/apps/webui/internal/db.py @@ -80,6 +80,13 @@ handle_peewee_migration() SQLALCHEMY_DATABASE_URL = DATABASE_URL + +# Replace the postgres:// with postgresql:// +if "postgres://" in SQLALCHEMY_DATABASE_URL: + SQLALCHEMY_DATABASE_URL = SQLALCHEMY_DATABASE_URL.replace( + "postgres://", "postgresql://" + ) + if "sqlite" in SQLALCHEMY_DATABASE_URL: engine = create_engine( SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}