mirror of
https://github.com/open-webui/open-webui
synced 2024-11-17 05:53:11 +00:00
fix: alembic
This commit is contained in:
parent
d3ef3a7494
commit
4b6ee584c2
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user