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
{{ message }}
Repository navigation
π¬ [P2] Add schema versioning to SQLite migrationsΒ #138
Schema migrations in store.rs are ad-hoc β checking column existence with SELECT * FROM memories LIMIT 0 and running ALTER TABLE. No version tracking, no ordered migration sequence, no rollback.
This worked for 5 versions but will break at scale:
Can't track which migrations have run
Can't roll back
Adding new columns requires careful ordering
Race conditions possible (multiple processes)
Proposed Solution
Add a schema_version table:
CREATETABLEIF NOT EXISTS schema_version (
version INTEGERNOT NULL,
applied_at TEXTNOT NULL,
description TEXT
);
Wrap all migrations in versioned functions:
constSCHEMA_VERSIONS:&[Migration] = &[(1,"initial schema"),(2,"add namespace column"),(3,"add access_count and last_accessed"),(4,"add memory_type, valid_from, valid_until, deprecated"),(5,"add memory_tags junction table"),// after #120];
Acceptance Criteria
schema_version table created on fresh install
Existing databases auto-detect current version and apply pending migrations
Migration order enforced (sequential)
Migration atomic (wrapped in transaction)
No data loss on migration
Tests: fresh install, upgrade from each version
Effort: ~1-2 days (depends on #120 tag storage refactor)
Activity
feat: v0.0.8 stability & architecture overhaul
feat: v0.0.8 β Stability & Architecture (#160)
ajianaz commentedon Jun 10, 2026
Already implemented in PR #263 (schema migration v1βv2 with integer version counter).
fix(edges): enforce namespace isolation on UUID/rel edges (#138)
feat: auto-wired memory edges (#346) (#375)
feat: v0.0.8 β Stability & Architecture (#160)
feat: auto-wired memory edges (#346) (#375)