Skip to content

feat(storage): versioned schema migrations - #48

Merged
Patel230 merged 6 commits into
mainfrom
feat/storage-migrations
Aug 15, 2026
Merged

feat(storage): versioned schema migrations#48
Patel230 merged 6 commits into
mainfrom
feat/storage-migrations

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

Phase 1 SQLite hardening (2/5). Merges after #47.

  • Add storage/migrate.go with a schema_version table and ordered, idempotent migrations
  • createTables() now applies the base schema only; later changes are migrations
  • Ships migrations adding node_metadata and embeddings_hnsw tables plus encryption columns

Merge order: after process-lock (#47).

- New storage/migrate.go: Migration framework with 5 migrations (initial schema, indexes, node_metadata, embeddings_hnsw, encryption columns)
- storage/sqlite.go: Simplified createTables() to only create schema_version + initial schema; calls Migrate() for remaining
- Integrity check + process lock acquired after migrations
- TestProcessLock verifies cross-process locking
CI triage on PR #48. lock.go carries the error-handling fix from the
process-lock branch ahead of merge.
- lock_unix.go/lock_windows.go carried over from the process-lock PR so
  windows builds pass (lock.go was unix-only)
- check tx.Rollback error in migrate.go

CI triage on PR #48.
# Conflicts:
#	storage/sqlite.go
@Patel230
Patel230 merged commit e98c35e into main Aug 15, 2026
12 checks passed
@Patel230
Patel230 deleted the feat/storage-migrations branch August 15, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant