Commit 4b6ee584 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

fix: alembic

parent d3ef3a74
...@@ -173,11 +173,14 @@ https://github.com/open-webui/open-webui ...@@ -173,11 +173,14 @@ https://github.com/open-webui/open-webui
def run_migrations(): def run_migrations():
from alembic.config import Config try:
from alembic import command from alembic.config import Config
from alembic import command
alembic_cfg = Config("alembic.ini") alembic_cfg = Config("alembic.ini")
command.upgrade(alembic_cfg, "head") command.upgrade(alembic_cfg, "head")
except Exception as e:
print(f"Error: {e}")
@asynccontextmanager @asynccontextmanager
......
...@@ -43,7 +43,7 @@ target_metadata = Auth.metadata ...@@ -43,7 +43,7 @@ target_metadata = Auth.metadata
DB_URL = DATABASE_URL DB_URL = DATABASE_URL
if DB_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: def run_migrations_offline() -> None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment