Timothy J. Baek 10 ay önce
ebeveyn
işleme
d51e866505
1 değiştirilmiş dosya ile 7 ekleme ve 0 silme
  1. 7 0
      backend/apps/webui/internal/db.py

+ 7 - 0
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}