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

@@ -27,18 +27,19 @@ const (
)
type Plan struct {
ID uuid.UUID `json:"id"`
ID int64 `json:"id"`
GUID uuid.UUID `json:"guid"`
Title string `json:"title"`
Description string `json:"description"`
Status PlanStatus `json:"status"`
Priority PlanPriority `json:"priority"`
ProjectID *uuid.UUID `json:"project_id,omitempty"`
ProjectID *int64 `json:"project_id,omitempty"`
Owner string `json:"owner,omitempty"`
DueDate *time.Time `json:"due_date,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
ReviewedBy string `json:"reviewed_by,omitempty"`
LastReviewedAt *time.Time `json:"last_reviewed_at,omitempty"`
SupersedesPlanID *uuid.UUID `json:"supersedes_plan_id,omitempty"`
SupersedesPlanID *int64 `json:"supersedes_plan_id,omitempty"`
Tags []string `json:"tags"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
@@ -56,7 +57,7 @@ type PlanDetail struct {
type PlanFilter struct {
Limit int
ProjectID *uuid.UUID
ProjectID *int64
Status string
Priority string
Owner string
@@ -77,7 +78,7 @@ type PlanUpdate struct {
ClearCompletedAt bool
ReviewedBy *string // "" to clear
MarkReviewed bool // sets last_reviewed_at = now()
SupersedesPlanID *uuid.UUID
SupersedesPlanID *int64
ClearSupersedesPlanID bool
Tags *[]string // nil = no change; replace when non-nil
}