mirror of
https://github.com/open-webui/scripts.git
synced 2026-11-05 01:38:18 +00:00
[PR #3] [MERGED] Updated cleanup_pg.py #3
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/scripts#3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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/scripts/pull/3
Author: @Ithanil
Created: 2/5/2026
Status: ✅ Merged
Merged: 2/23/2026
Merged by: @tjbck
Base:
main← Head:update_cleanup📝 Commits (1)
d1fe255updated cleanup_pg.py with \u0020 sanitization and check for files used in memory&folders📊 Changes
1 file changed (+92 additions, -12 deletions)
View changed files
📝
scripts/cleanup_pg/cleanup_pg.py(+92 -12)📄 Description
This Pull Request improves the
cleanup_pg.pyscript by introducing automated chat content sanitization and expanding the scope of the database cleanup to ensure no orphaned files or collections remain after deletion.Key Changes:
--sanitizeflag andsanitize_chatsfunction to replace null characters (\u0000) with spaces (\u0020) in the chat JSONB column to prevent potential database processing errors.find_referenced_filesto search across more tables and paths, including:chat_fileandknowledge_filerelational tables.foldertable's metadata.chattable ($.files.id).cleanup_chatsfunction now performs a cascading-style cleanup by removing entries in thechat_filetable associated with deleted chats.find_referenced_collectionsto better identify collections used in user memory and new file attachment structures.Notes:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.