refactor(DIS-108): extract DB schema to src/db/schema.sql (SSOT) #50
No reviewers
Labels
No labels
blocked
needs-review
phase:0
phase:1
phase:1.5
phase:2
phase:3
phase:4
phase:5
phase:6+
priority:p0
priority:p1
priority:p2
security
type:chore
type:ci
type:docs
type:feat
type:fix
type:idea
type:known-issue
type:refactor
type:test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: dev/disclaw#50
Loading…
Reference in a new issue
No description provided.
Delete branch "phase-1/db-schema-ssot"
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
CREATE TABLE/CREATE INDEXDDL out ofdatabase.tsintosrc/db/schema.sql(single source of truth)database.tsnow loadsschema.sqlat startup viafs.readFileSyncand applies it withdb.exec(schema)IF NOT EXISTSfor idempotent schema initializationtests/integration/db-init.test.tswith 3 tests: table existence, idempotency, and basic workspace CRUDTest plan
npx vitest run tests/integration/db-init.test.ts� all 3 tests passnpx vitest run� full suite (47 tests) still green