mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 20:07:49 +01:00
feat: config.json db migration
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import base64
|
||||
import uuid
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
from authlib.integrations.starlette_client import OAuth
|
||||
from authlib.oidc.core import UserInfo
|
||||
import json
|
||||
@@ -87,6 +86,7 @@ from utils.misc import (
|
||||
from apps.rag.utils import get_rag_context, rag_template
|
||||
|
||||
from config import (
|
||||
run_migrations,
|
||||
WEBUI_NAME,
|
||||
WEBUI_URL,
|
||||
WEBUI_AUTH,
|
||||
@@ -165,17 +165,6 @@ 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
|
||||
async def lifespan(app: FastAPI):
|
||||
run_migrations()
|
||||
|
||||
Reference in New Issue
Block a user