You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before shipping to real users, NodeSpace needs a versioned DDL migration runner so schema changes can be applied to existing databases without data loss.
Problem
`initialize_schema` currently runs `CREATE TABLE IF NOT EXISTS` — idempotent for fresh databases, but silent no-op for existing ones. Any new top-level column added to `node`, `relationship`, or `embedding` will be missing from databases created before that change.
Required Behavior
On startup, `initialize_schema` should:
Read `PRAGMA user_version`
Compare against the app's expected schema version constant
Execute any pending migrations in order (e.g. `ALTER TABLE node ADD COLUMN ...`)
Bump `user_version` to match
Migration File Convention
Each migration is a numbered SQL file or inline Rust constant:
`001_initial_schema` — current schema.sql contents, baseline
`002_add_node_subtitle` — example future migration
Never edit a past migration, only append new ones
`schema.sql` either becomes a human-readable reference (not executed directly) or is removed in favor of deriving current schema from running all migrations on a fresh DB.
Acceptance Criteria
`PRAGMA user_version` is used to track applied migration version
Current schema is canonicalized as migration `001`
New DDL changes are added as numbered migrations, not edits to `schema.sql`
A user on migration `001` who upgrades gets all subsequent migrations applied in order
Activity
malibio commentedon Jul 11, 2026
Frontend: 4019 passed (158 files)
SQLite DDL migration runner (pre-launch requirement) (#1622)