Files
amcs/schema/meta.dbml
sgcommand 27cd494f6d
Some checks failed
CI / build-and-test (push) Failing after -32m1s
CI / build-and-test (pull_request) Failing after -32m3s
feat(schema): add structured learnings DBML model
2026-04-22 13:40:44 +02:00

76 lines
2.2 KiB
Plaintext

Table chat_histories {
id uuid [pk, default: `gen_random_uuid()`]
session_id text [not null]
title text
channel text
agent_id text
project_id uuid [ref: > projects.guid]
messages jsonb [not null, default: `'[]'`]
summary text
metadata jsonb [not null, default: `'{}'`]
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz [not null, default: `now()`]
indexes {
session_id
project_id
channel
agent_id
created_at
}
}
Table tool_annotations {
id bigserial [pk]
tool_name text [unique, not null]
notes text [not null, default: '']
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz [not null, default: `now()`]
}
// Cross-file refs (for relspecgo merge)
Ref: chat_histories.project_id > projects.guid [delete: set null]
Table learnings {
id uuid [pk, default: `gen_random_uuid()`]
summary text [not null]
details text [not null, default: '']
category text [not null, default: 'insight']
area text [not null, default: 'other']
status text [not null, default: 'pending']
priority text [not null, default: 'medium']
confidence text [not null, default: 'hypothesis']
action_required boolean [not null, default: false]
source_type text
source_ref text
project_id uuid [ref: > projects.guid]
related_thought_id uuid [ref: > thoughts.guid]
related_skill_id uuid [ref: > agent_skills.id]
reviewed_by text
reviewed_at timestamptz
duplicate_of_learning_id uuid [ref: > learnings.id]
supersedes_learning_id uuid [ref: > learnings.id]
tags "text[]" [not null, default: `'{}'`]
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz [not null, default: `now()`]
indexes {
project_id
category
area
status
priority
reviewed_at
tags [type: gin]
summary [type: gin]
details [type: gin]
}
}
// Cross-file refs (for relspecgo merge)
Ref: learnings.project_id > projects.guid [delete: set null]
Ref: learnings.related_thought_id > thoughts.guid [delete: set null]
Ref: learnings.related_skill_id > agent_skills.id [delete: set null]
Ref: learnings.duplicate_of_learning_id > learnings.id [delete: set null]
Ref: learnings.supersedes_learning_id > learnings.id [delete: set null]