refactor(store,tools): migrate IDs from UUID to bigserial int64
Some checks failed
CI / build-and-test (push) Failing after -31m12s

All internal entity lookups now use bigserial primary keys (int64) while
GUIDs are retained for external/public identification. Updated store
functions (TouchProject, UpdateThoughtMetadata, AddThoughtAttachment) to
query by id instead of guid, added GetThoughtByID, changed semanticSearch
and all tool helpers to use *int64 project IDs, and updated retry/backfill
workers to use int64 thought IDs throughout.
This commit is contained in:
2026-05-03 11:43:34 +02:00
parent 9e6d05e055
commit 91239bcf4b
58 changed files with 1208 additions and 2774 deletions

View File

@@ -217,7 +217,8 @@ type ContactHistory struct {
// Agent Skills & Guardrails
type AgentSkill struct {
ID uuid.UUID `json:"id"`
ID int64 `json:"id"`
GUID uuid.UUID `json:"guid"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Content string `json:"content"`
@@ -227,7 +228,8 @@ type AgentSkill struct {
}
type AgentGuardrail struct {
ID uuid.UUID `json:"id"`
ID int64 `json:"id"`
GUID uuid.UUID `json:"guid"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Content string `json:"content"`
@@ -245,12 +247,13 @@ type ChatMessage struct {
}
type ChatHistory struct {
ID uuid.UUID `json:"id"`
ID int64 `json:"id"`
GUID uuid.UUID `json:"guid"`
SessionID string `json:"session_id"`
Title string `json:"title,omitempty"`
Channel string `json:"channel,omitempty"`
AgentID string `json:"agent_id,omitempty"`
ProjectID *uuid.UUID `json:"project_id,omitempty"`
ProjectID *int64 `json:"project_id,omitempty"`
Messages []ChatMessage `json:"messages"`
Summary string `json:"summary,omitempty"`
Metadata map[string]any `json:"metadata"`