mirror of
https://github.com/open-webui/open-webui
synced 2025-01-30 14:29:55 +00:00
fix
This commit is contained in:
parent
95426fc6c9
commit
3b27acc77e
@ -81,12 +81,6 @@ handle_peewee_migration()
|
|||||||
|
|
||||||
SQLALCHEMY_DATABASE_URL = DATABASE_URL
|
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:
|
if "sqlite" in SQLALCHEMY_DATABASE_URL:
|
||||||
engine = create_engine(
|
engine = create_engine(
|
||||||
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
|
SQLALCHEMY_DATABASE_URL, connect_args={"check_same_thread": False}
|
||||||
|
@ -1331,3 +1331,7 @@ AUDIO_TTS_VOICE = PersistentConfig(
|
|||||||
####################################
|
####################################
|
||||||
|
|
||||||
DATABASE_URL = os.environ.get("DATABASE_URL", f"sqlite:///{DATA_DIR}/webui.db")
|
DATABASE_URL = os.environ.get("DATABASE_URL", f"sqlite:///{DATA_DIR}/webui.db")
|
||||||
|
|
||||||
|
# Replace the postgres:// with postgresql://
|
||||||
|
if "postgres://" in DATABASE_URL:
|
||||||
|
DATABASE_URL = DATABASE_URL.replace("postgres://", "postgresql://")
|
||||||
|
@ -49,6 +49,9 @@ if DB_URL:
|
|||||||
config.set_main_option("sqlalchemy.url", DB_URL)
|
config.set_main_option("sqlalchemy.url", DB_URL)
|
||||||
|
|
||||||
|
|
||||||
|
print("DB_URL", DB_URL)
|
||||||
|
|
||||||
|
|
||||||
def run_migrations_offline() -> None:
|
def run_migrations_offline() -> None:
|
||||||
"""Run migrations in 'offline' mode.
|
"""Run migrations in 'offline' mode.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user