Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
3b27acc7
Commit
3b27acc7
authored
Jul 08, 2024
by
Timothy J. Baek
Browse files
fix
parent
95426fc6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
backend/apps/webui/internal/db.py
backend/apps/webui/internal/db.py
+0
-6
backend/config.py
backend/config.py
+4
-0
backend/migrations/env.py
backend/migrations/env.py
+3
-0
No files found.
backend/apps/webui/internal/db.py
View file @
3b27acc7
...
@@ -81,12 +81,6 @@ handle_peewee_migration()
...
@@ -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
}
...
...
backend/config.py
View file @
3b27acc7
...
@@ -1331,3 +1331,7 @@ AUDIO_TTS_VOICE = PersistentConfig(
...
@@ -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://"
)
backend/migrations/env.py
View file @
3b27acc7
...
@@ -49,6 +49,9 @@ if DB_URL:
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment