[schemas] Make enhanced-thoughts self-contained for status columns#305
Conversation
upsert_thought wrote to status/status_updated_at but the columns were only added by schemas/workflow-status. Anyone applying enhanced-thoughts alone (as docs/01-getting-started.md instructs) got "column status does not exist" on capture_thought. Add idempotent ADD COLUMN IF NOT EXISTS so the RPC's dependencies live in the same file. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Thanks for the contribution. This closes a real gap: Checked the column definitions against — Alan (community reviewer; non-binding) |
justfinethanku
left a comment
There was a problem hiding this comment.
Maintainer review complete. This is the smallest safe fix for the missing status/status_updated_at dependency in enhanced-thoughts, and Alan already verified the definitions match workflow-status.
Contribution Type
/schemas)What does this do?
Fixes a hidden cross-schema dependency in
schemas/enhanced-thoughts/schema.sql. Theupsert_thoughtRPC defined in that file writes tostatusandstatus_updated_at, but those columns are only added byschemas/workflow-status/migration.sql.docs/01-getting-started.mdonly instructs users to applyenhanced-thoughts, so following the getting-started path produces a broken RPC andcapture_thoughtfails with:This PR adds idempotent
ADD COLUMN IF NOT EXISTSforstatus/status_updated_at(and the matching partial index) directly inenhanced-thoughts/schema.sql, so the RPC's dependencies live in the same file. Both schemas useIF NOT EXISTS, so users who already ranworkflow-statusare unaffected.Requirements
None — pure SQL change in an existing schema file.
Checklist
README.mdwith prerequisites, step-by-step instructions, and expected outcome — N/A, edit to existing schemametadata.jsonhas all required fields — N/A, no metadata changecapture_thoughtnow succeeds)