- Add explicit Ref: blocks at bottom of each DBML file for cross-file FK relationships - files.dbml: stored_files → thoughts, projects - skills.dbml: project_skills/project_guardrails → projects - meta.dbml: chat_histories → projects - Update Makefile to use the relspec merge workflow where applicable - Regenerate 020_generated_schema.sql with proper cross-file constraints Addresses review comment on PR #20
33 lines
821 B
Plaintext
33 lines
821 B
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]
|