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.
50 lines
1.2 KiB
Plaintext
50 lines
1.2 KiB
Plaintext
Table thoughts {
|
|
id bigserial [pk]
|
|
guid uuid [unique, not null, default: `gen_random_uuid()`]
|
|
content text [not null]
|
|
metadata jsonb [default: `'{}'::jsonb`]
|
|
created_at timestamptz [default: `now()`]
|
|
updated_at timestamptz [default: `now()`]
|
|
project_id bigint [ref: > projects.id]
|
|
archived_at timestamptz
|
|
}
|
|
|
|
Table projects {
|
|
id bigserial [pk]
|
|
guid uuid [unique, not null, default: `gen_random_uuid()`]
|
|
name text [unique, not null]
|
|
description text
|
|
created_at timestamptz [default: `now()`]
|
|
last_active_at timestamptz [default: `now()`]
|
|
}
|
|
|
|
Table thought_links {
|
|
id bigserial [pk]
|
|
from_id bigint [not null, ref: > thoughts.id]
|
|
to_id bigint [not null, ref: > thoughts.id]
|
|
relation text [not null]
|
|
created_at timestamptz [default: `now()`]
|
|
|
|
indexes {
|
|
(from_id, to_id, relation) [pk]
|
|
from_id
|
|
to_id
|
|
}
|
|
}
|
|
|
|
Table embeddings {
|
|
id bigserial [pk]
|
|
guid uuid [unique, not null, default: `gen_random_uuid()`]
|
|
thought_id bigint [not null, ref: > thoughts.id]
|
|
model text [not null]
|
|
dim int [not null]
|
|
embedding vector [not null]
|
|
created_at timestamptz [default: `now()`]
|
|
updated_at timestamptz [default: `now()`]
|
|
|
|
indexes {
|
|
(thought_id, model) [unique]
|
|
thought_id
|
|
}
|
|
}
|