fix: add cross-file Ref declarations for relspecgo merge

- 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
This commit is contained in:
2026-04-04 15:13:50 +02:00
parent 59c43188e5
commit 6c6b49b45c
4 changed files with 18 additions and 2 deletions

View File

@@ -19,3 +19,7 @@ Table stored_files {
sha256
}
}
// 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]

View File

@@ -27,3 +27,6 @@ Table tool_annotations {
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]

View File

@@ -40,3 +40,7 @@ Table project_guardrails {
project_id
}
}
// Cross-file refs (for relspecgo merge)
Ref: project_skills.project_id > projects.guid [delete: cascade]
Ref: project_guardrails.project_id > projects.guid [delete: cascade]