mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #21739] [CLOSED] fix: drop unique index on tag(id) to fix duplicate-key errors #49302
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/21739
Author: @martional
Created: 2/22/2026
Status: ❌ Closed
Base:
dev← Head:fix/drop-tag-id-unique-index📝 Commits (1)
0e4622cfix: drop unique index on tag(id) to fix duplicate-key errors📊 Changes
1 file changed (+53 additions, -0 deletions)
View changed files
➕
backend/open_webui/migrations/versions/c8d4e5f6a7b8_drop_tag_id_unique_index.py(+53 -0)📄 Description
fix: drop unique index on tag(id) to fix duplicate-key errors
Fixes #21737
Pull Request Checklist
devbranchDescription
Drops any leftover unique index on
tag.idalone that conflicts with the composite primary key(id, user_id). In some upgrade paths or database engines, a unique index onidalone can persist from the original schema and causeUNIQUE constraint failed: tag.id(SQLite) or equivalent errors when multiple users create tags with the same name.Changes:
c8d4e5f6a7b8_drop_tag_id_unique_index.pythat inspects the tag table and drops any unique index onidalone if it existsChangelog Entry
Description
tag.idwhen it conflicts with composite PK(id, user_id), fixing duplicate-key errors when multiple users create tags with the same name.Fixed
UNIQUE constraint failed: tag.id(SQLite) / duplicate key violation (PostgreSQL) when different users create tags with the same nameAdditional Information
3ab32c4b8f59_update_tags.pyattempted to drop conflicting indexes, but in some upgrade paths a unique index onidalone can persist. This migration explicitly drops such indexes if they exist.Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.