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:
@@ -1,8 +1,8 @@
|
||||
Table stored_files {
|
||||
id bigserial [pk]
|
||||
guid uuid [unique, not null, default: `gen_random_uuid()`]
|
||||
thought_id uuid [ref: > thoughts.guid]
|
||||
project_id uuid [ref: > projects.guid]
|
||||
thought_id bigint [ref: > thoughts.id]
|
||||
project_id bigint [ref: > projects.id]
|
||||
name text [not null]
|
||||
media_type text [not null]
|
||||
kind text [not null, default: 'file']
|
||||
@@ -21,5 +21,5 @@ Table stored_files {
|
||||
}
|
||||
|
||||
// Cross-file refs (for relspecgo merge)
|
||||
Ref: stored_files.thought_id > thoughts.guid [delete: set null]
|
||||
Ref: stored_files.project_id > projects.guid [delete: set null]
|
||||
Ref: stored_files.thought_id > thoughts.id [delete: set null]
|
||||
Ref: stored_files.project_id > projects.id [delete: set null]
|
||||
|
||||
Reference in New Issue
Block a user