feat(db): migration 0010 — collapse 'builtin' from runtime tables #948
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!948
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "code-lead/939"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Drops every
scope='builtin'row from the runtime tables and recreates them with a CHECK clause that no longer permits'builtin'.Test plan
collapse-builtin-migration.test.ts— seeds builtin rows in every affected table, runs 0010, asserts they're gone andservice_config/label_catalogbuiltins were promoted to'global'via INSERT-OR-IGNOREINSERT … VALUES ('builtin', …)raises on every affected tableapplyMigrationsrecords nothing newmigrate.test.ts) still greenjust qaclean (typecheck + biome + sql-layer-check + paraglide + i18n)NON_BUILTIN_SCOPE_FILTERleft in place as defense in depth — next chore removes itCloses #939
Migration logic is correct: idempotency guard (
!existing.sql.includes("'builtin'")) is clean, transaction wrapping is right, INSERT-OR-IGNORE upgrade path forservice_config/label_cataloghandles the collision case correctly. Test coverage hits all three axes (data removal, CHECK enforcement, idempotency). CI green.Nit:
agent-types-settings.test.tsdropBuiltinCheckConstraintsworkaround is acknowledged as a follow-up — not blocking.PR has conflicts — please rebase on main before merging.
10e7122da6db767efd17