refactor(store,tools): migrate IDs from UUID to bigserial int64
Some checks failed
CI / build-and-test (push) Failing after -31m12s
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:
@@ -30,9 +30,10 @@ type ThoughtAttachment struct {
|
||||
}
|
||||
|
||||
type StoredFile struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
ThoughtID *uuid.UUID `json:"thought_id,omitempty"`
|
||||
ProjectID *uuid.UUID `json:"project_id,omitempty"`
|
||||
ID int64 `json:"id"`
|
||||
GUID uuid.UUID `json:"guid"`
|
||||
ThoughtID *int64 `json:"thought_id,omitempty"`
|
||||
ProjectID *int64 `json:"project_id,omitempty"`
|
||||
Name string `json:"name"`
|
||||
MediaType string `json:"media_type"`
|
||||
Kind string `json:"kind"`
|
||||
@@ -46,25 +47,26 @@ type StoredFile struct {
|
||||
|
||||
type StoredFileFilter struct {
|
||||
Limit int
|
||||
ThoughtID *uuid.UUID
|
||||
ProjectID *uuid.UUID
|
||||
ThoughtID *int64
|
||||
ProjectID *int64
|
||||
Kind string
|
||||
}
|
||||
|
||||
type Thought struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
ID int64 `json:"id"`
|
||||
GUID uuid.UUID `json:"guid"`
|
||||
Content string `json:"content"`
|
||||
Embedding []float32 `json:"embedding,omitempty"`
|
||||
EmbeddingStatus string `json:"embedding_status,omitempty"`
|
||||
Metadata ThoughtMetadata `json:"metadata"`
|
||||
ProjectID *uuid.UUID `json:"project_id,omitempty"`
|
||||
ProjectID *int64 `json:"project_id,omitempty"`
|
||||
ArchivedAt *time.Time `json:"archived_at,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type SearchResult struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
ID int64 `json:"id"`
|
||||
Content string `json:"content"`
|
||||
Metadata ThoughtMetadata `json:"metadata"`
|
||||
Similarity float64 `json:"similarity"`
|
||||
@@ -77,7 +79,7 @@ type ListFilter struct {
|
||||
Topic string
|
||||
Person string
|
||||
Days int
|
||||
ProjectID *uuid.UUID
|
||||
ProjectID *int64
|
||||
IncludeArchived bool
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user