Timothy J. Baek 8 月之前
父节点
当前提交
175ffc5c66
共有 4 个文件被更改,包括 9 次插入6 次删除
  1. 1 1
      backend/open_webui/alembic.ini
  2. 5 2
      backend/open_webui/config.py
  3. 2 2
      package-lock.json
  4. 1 1
      package.json

+ 1 - 1
backend/open_webui/alembic.ini

@@ -2,7 +2,7 @@
 
 
 [alembic]
 [alembic]
 # path to migration scripts
 # 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
 # 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
 # Uncomment the line below if you want the files to be prepended with date and time

+ 5 - 2
backend/open_webui/config.py

@@ -46,9 +46,12 @@ def run_migrations():
         from alembic import command
         from alembic import command
         from alembic.config import Config
         from alembic.config import Config
 
 
-        print(OPEN_WEBUI_DIR)
-
         alembic_cfg = Config(OPEN_WEBUI_DIR / "alembic.ini")
         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")
         command.upgrade(alembic_cfg, "head")
     except Exception as e:
     except Exception as e:
         print(f"Error: {e}")
         print(f"Error: {e}")

+ 2 - 2
package-lock.json

@@ -1,12 +1,12 @@
 {
 {
 	"name": "open-webui",
 	"name": "open-webui",
-	"version": "0.3.17.dev4",
+	"version": "0.3.17.dev5",
 	"lockfileVersion": 3,
 	"lockfileVersion": 3,
 	"requires": true,
 	"requires": true,
 	"packages": {
 	"packages": {
 		"": {
 		"": {
 			"name": "open-webui",
 			"name": "open-webui",
-			"version": "0.3.17.dev4",
+			"version": "0.3.17.dev5",
 			"dependencies": {
 			"dependencies": {
 				"@codemirror/lang-javascript": "^6.2.2",
 				"@codemirror/lang-javascript": "^6.2.2",
 				"@codemirror/lang-python": "^6.1.6",
 				"@codemirror/lang-python": "^6.1.6",

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
 	"name": "open-webui",
 	"name": "open-webui",
-	"version": "0.3.17.dev4",
+	"version": "0.3.17.dev5",
 	"private": true,
 	"private": true,
 	"scripts": {
 	"scripts": {
 		"dev": "npm run pyodide:fetch && vite dev --host",
 		"dev": "npm run pyodide:fetch && vite dev --host",