diff --git a/backend/open_webui/alembic.ini b/backend/open_webui/alembic.ini index bf77571ec..4eff85f0c 100644 --- a/backend/open_webui/alembic.ini +++ b/backend/open_webui/alembic.ini @@ -2,7 +2,7 @@ [alembic] # path to migration scripts -script_location = open_webui/migrations +script_location = migrations # template used to generate migration file names; The default value is %%(rev)s_%%(slug)s # Uncomment the line below if you want the files to be prepended with date and time diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index f62a45eac..2e3f1b2b8 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -46,9 +46,12 @@ def run_migrations(): from alembic import command from alembic.config import Config - print(OPEN_WEBUI_DIR) - alembic_cfg = Config(OPEN_WEBUI_DIR / "alembic.ini") + + # Set the script location dynamically + migrations_path = OPEN_WEBUI_DIR / "migrations" + alembic_cfg.set_main_option("script_location", str(migrations_path)) + command.upgrade(alembic_cfg, "head") except Exception as e: print(f"Error: {e}") diff --git a/package-lock.json b/package-lock.json index 8b047ccf7..a11e69317 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "open-webui", - "version": "0.3.17.dev4", + "version": "0.3.17.dev5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "open-webui", - "version": "0.3.17.dev4", + "version": "0.3.17.dev5", "dependencies": { "@codemirror/lang-javascript": "^6.2.2", "@codemirror/lang-python": "^6.1.6", diff --git a/package.json b/package.json index 2effb2498..ac45c9eda 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-webui", - "version": "0.3.17.dev4", + "version": "0.3.17.dev5", "private": true, "scripts": { "dev": "npm run pyodide:fetch && vite dev --host",