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.
Schema workflow
The schema/*.dbml files are the database schema source of truth.
Generate SQL migrations
Run:
make generate-migrations
This uses relspec to convert the DBML files into PostgreSQL SQL and writes the generated schema migration to:
migrations/020_generated_schema.sql
Generate ResolveSpec models
Run:
make generate-models
This uses relspec to convert schema/*.dbml into Bun/ResolveSpec-compatible
Go models in:
internal/generatedmodels/
Check schema drift
Run:
make check-schema-drift
This regenerates the SQL from schema/*.dbml and compares it with migrations/020_generated_schema.sql.
If the generated output differs, the command fails so CI can catch schema drift.
Workflow
- Update the DBML files in
schema/ - Run
make generate-migrations - Run
make generate-models - Review generated SQL and generated models
- Commit DBML changes and generated outputs
Existing handwritten migrations stay in place. Going forward, update the DBML first and regenerate the SQL from there.