From 2cf2565e80413dd7a661cd5153a6643dd4e801d9 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Wed, 4 Feb 2026 22:57:46 -0600 Subject: [PATCH] refac --- .../versions/8452d01d26d7_add_chat_message_table.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py b/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py index 5a139db3e2..310df83f03 100644 --- a/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py +++ b/backend/open_webui/migrations/versions/8452d01d26d7_add_chat_message_table.py @@ -88,9 +88,11 @@ def upgrade() -> None: sa.column("updated_at", sa.BigInteger()), ) - # Fetch all chats + # Fetch all chats (excluding shared chats which contain 'shared' in id) chats = conn.execute( - sa.select(chat_table.c.id, chat_table.c.user_id, chat_table.c.chat) + sa.select(chat_table.c.id, chat_table.c.user_id, chat_table.c.chat).where( + ~chat_table.c.id.like("%shared%") + ) ).fetchall() now = int(time.time())