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,5 +1,6 @@
|
||||
Table agent_skills {
|
||||
id uuid [pk, default: `gen_random_uuid()`]
|
||||
id bigserial [pk]
|
||||
guid uuid [unique, not null, default: `gen_random_uuid()`]
|
||||
name text [unique, not null]
|
||||
description text [not null, default: '']
|
||||
content text [not null]
|
||||
@@ -9,7 +10,8 @@ Table agent_skills {
|
||||
}
|
||||
|
||||
Table agent_guardrails {
|
||||
id uuid [pk, default: `gen_random_uuid()`]
|
||||
id bigserial [pk]
|
||||
guid uuid [unique, not null, default: `gen_random_uuid()`]
|
||||
name text [unique, not null]
|
||||
description text [not null, default: '']
|
||||
content text [not null]
|
||||
@@ -20,9 +22,9 @@ Table agent_guardrails {
|
||||
}
|
||||
|
||||
Table project_skills {
|
||||
id serial [pk]
|
||||
project_id uuid [not null, ref: > projects.guid]
|
||||
skill_id uuid [not null, ref: > agent_skills.id]
|
||||
id bigserial [pk]
|
||||
project_id bigint [not null, ref: > projects.id]
|
||||
skill_id bigint [not null, ref: > agent_skills.id]
|
||||
created_at timestamptz [not null, default: `now()`]
|
||||
|
||||
indexes {
|
||||
@@ -32,9 +34,9 @@ Table project_skills {
|
||||
}
|
||||
|
||||
Table project_guardrails {
|
||||
id serial [pk]
|
||||
project_id uuid [not null, ref: > projects.guid]
|
||||
guardrail_id uuid [not null, ref: > agent_guardrails.id]
|
||||
id bigserial [pk]
|
||||
project_id bigint [not null, ref: > projects.id]
|
||||
guardrail_id bigint [not null, ref: > agent_guardrails.id]
|
||||
created_at timestamptz [not null, default: `now()`]
|
||||
|
||||
indexes {
|
||||
@@ -44,5 +46,7 @@ Table project_guardrails {
|
||||
}
|
||||
|
||||
// Cross-file refs (for relspecgo merge)
|
||||
Ref: project_skills.project_id > projects.guid [delete: cascade]
|
||||
Ref: project_guardrails.project_id > projects.guid [delete: cascade]
|
||||
Ref: project_skills.project_id > projects.id [delete: cascade]
|
||||
Ref: project_skills.skill_id > agent_skills.id [delete: cascade]
|
||||
Ref: project_guardrails.project_id > projects.id [delete: cascade]
|
||||
Ref: project_guardrails.guardrail_id > agent_guardrails.id [delete: cascade]
|
||||
|
||||
Reference in New Issue
Block a user