plan(iter-3.5): add Phase 0.8 — schema bootstrap fix #20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "plan/phase-0.8-schema-bootstrap"
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?
Summary
Adds Phase 0.8 to the iter-3.4 stream-a-thon plan, capturing a foot-gun caught during Phase 1.1 dev on 2026-05-20: a fresh
sources.dbis missinggroup_name/group_uuidon theteamstable, becauselib/database.ts:initializeDatabase()only creates(team_id, team_name). Those columns were added later via standalone migration scripts that aren't auto-run on cold start, so/api/streamsreturnsSQLITE_ERROR: no such column: t.group_nameon any cold checkout.Event-day risk: if a hot-spare laptop is provisioned at the venue, this fires on first boot.
What the plan now says
New Phase 0.8 section between Phase 0.7 and Phase 1, total 0.25 d, runs alongside Phase 0.7 (no shared surface):
group_name TEXT+group_uuid TEXTinto theCREATE TABLE IF NOT EXISTSfor teams inlib/database.ts. Keep the migration scripts (idempotent — they checkPRAGMA table_infofirst).Array.isArray(...)guard in the home page's API-response unwrap (app/page.tsx:80-81) so future schema-drift bugs degrade to "empty list" rather than crashing the React render.lib/__tests__/database.test.tsthat opens an in-memory SQLite, runsinitializeDatabase(), and asserts every column referenced by runtime route SELECTs is present. Catches future drift in CI.Day-math updated: +0.25 d → total nominal ~29.80 d; honest slack narrows to +0.20 to +1.20 d (still positive).
Test plan
This PR is plan-only. The implementation work happens against the plan in a subsequent code PR (won't be bundled into the in-flight Phase 1 branch / PR #19, since that's already in review).
Out of scope
group_name/group_uuidfor existing populated DBs — migration scripts already do that; this is about fresh-DB bootstrap only.