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
4b6ee584
Commit
4b6ee584
authored
Jul 08, 2024
by
Timothy J. Baek
Browse files
fix: alembic
parent
d3ef3a74
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
backend/main.py
backend/main.py
+7
-4
backend/migrations/env.py
backend/migrations/env.py
+1
-1
No files found.
backend/main.py
View file @
4b6ee584
...
...
@@ -173,11 +173,14 @@ https://github.com/open-webui/open-webui
def
run_migrations
():
try
:
from
alembic.config
import
Config
from
alembic
import
command
alembic_cfg
=
Config
(
"alembic.ini"
)
command
.
upgrade
(
alembic_cfg
,
"head"
)
except
Exception
as
e
:
print
(
f
"Error:
{
e
}
"
)
@
asynccontextmanager
...
...
backend/migrations/env.py
View file @
4b6ee584
...
...
@@ -43,7 +43,7 @@ target_metadata = Auth.metadata
DB_URL
=
DATABASE_URL
if
DB_URL
:
config
.
set_main_option
(
"sqlalchemy.url"
,
DB_URL
)
config
.
set_main_option
(
"sqlalchemy.url"
,
DB_URL
.
replace
(
"%"
,
"%%"
)
)
def
run_migrations_offline
()
->
None
:
...
...
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