mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #8510] [MERGED] Add DATABASE_SCHEMA as env var #9034
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/8510
Author: @MadsLang
Created: 1/13/2025
Status: ✅ Merged
Merged: 1/13/2025
Merged by: @tjbck
Base:
dev← Head:main📝 Commits (3)
3321885add option to add database schema as env var6f1065bMerge branch 'dev' of github.com:open-webui/open-webuid4a26f8Merge branch 'open-webui:main' into main📊 Changes
2 files changed (+6 additions, -2 deletions)
View changed files
📝
backend/open_webui/env.py(+2 -0)📝
backend/open_webui/internal/db.py(+4 -2)📄 Description
Changelog Entry
Description
When using Postgresql as database, there can be conflicts between reserved keywords like "user" and the table names, e.g. "user". I have described this in https://github.com/open-webui/open-webui/issues/7750. To fix this problem, I added the option to set DATABASE_SCHEMA as an environment variable, that sets a default schema to use for all tables for the internal database.
Added
The options to use the environment variable DATABASE_SCHEMA. This sets a default schema in the sqlalchemy ORM definition using the MetaData class described here.
Additional information
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.