feat(knowledge-base): implement per-user pinning for knowledge bases

Refactored the pinning mechanism for knowledge bases to be user-specific, allowing any user with read access to pin knowledge bases independently. This change includes the introduction of a new `user_kb_pins` table to manage pin states, replacing the previous tenant-wide pinning system. Updated relevant API endpoints and service logic to support this new functionality, ensuring that the UI reflects the user's personal pin status.

Additionally, adjusted the knowledge base listing to sort by user-specific pin status, enhancing the user experience by prioritizing pinned items.

Refs: #1303
This commit is contained in:
wizardchen
2026-05-18 11:58:46 +08:00
committed by lyingbug
parent 4aedf5fd62
commit 7528175a74
10 changed files with 355 additions and 71 deletions
+1
View File
@@ -1,4 +1,5 @@
DROP TABLE IF EXISTS tenant_invitations;
DROP TABLE IF EXISTS user_kb_pins;
DROP TABLE IF EXISTS user_resource_favorites;
DROP TABLE IF EXISTS tenant_disabled_shared_agents;
DROP TABLE IF EXISTS agent_shares;