feat: DBML schema files + relspecgo migration generation #20

Merged
warkanum merged 2 commits from feat/dbml-schema-relspecgo into main 2026-04-04 13:37:26 +00:00
Member

Closes #19

What this does

  • Adds schema/*.dbml — canonical DBML schema definitions for all tables
  • Wires relspecgo via make generate-migrations
  • Adds make check-schema-drift for CI validation
  • Adds schema/README.md with developer workflow docs

How to use

make generate-migrations
make check-schema-drift

Notes

  • Existing migrations (001-019, 100) are untouched
  • Going forward: edit .dbml files, run make generate-migrations, commit both
Closes #19 ## What this does - Adds schema/*.dbml — canonical DBML schema definitions for all tables - Wires relspecgo via make generate-migrations - Adds make check-schema-drift for CI validation - Adds schema/README.md with developer workflow docs ## How to use make generate-migrations make check-schema-drift ## Notes - Existing migrations (001-019, 100) are untouched - Going forward: edit .dbml files, run make generate-migrations, commit both
sgcommand added 1 commit 2026-04-04 12:53:46 +00:00
- Add schema/*.dbml covering all existing tables (001-019)
- Wire relspecgo via make generate-migrations target
- Add make check-schema-drift for CI drift detection
- Add schema/README.md documenting the DBML-first workflow

Closes #19
Owner

Add proper relationships. For relspec to link them, you have to use merge.
Baiscally add a commented out ref at the bottom of a file to refrences another files table. e.g.
#Ref: "org"."role"."rid_owner" - "org"."owner"."id_owner" [delete: cascade, update: restrict]

Add proper relationships. For relspec to link them, you have to use merge. Baiscally add a commented out ref at the bottom of a file to refrences another files table. e.g. #Ref: "org"."role"."rid_owner" - "org"."owner"."id_owner" [delete: cascade, update: restrict]
Author
Member

Fixed — added explicit Ref: declarations at the bottom of each DBML file for all cross-file foreign key relationships (files→core, skills→core, meta→core). Also updated the Makefile to use the relspecgo merge workflow where applicable. Regenerated 020_generated_schema.sql with proper cross-file FK constraints.

Fixed — added explicit `Ref:` declarations at the bottom of each DBML file for all cross-file foreign key relationships (files→core, skills→core, meta→core). Also updated the Makefile to use the relspecgo merge workflow where applicable. Regenerated `020_generated_schema.sql` with proper cross-file FK constraints.
sgcommand added 1 commit 2026-04-04 13:13:52 +00:00
- 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
warkanum approved these changes 2026-04-04 13:37:23 +00:00
warkanum merged commit 4713110e32 into main 2026-04-04 13:37:26 +00:00
Sign in to join this conversation.