feat: add ordered store migrations

This commit is contained in:
Eric Wendland 2026-07-05 17:54:02 +02:00
commit bf970fdc76
3 changed files with 178 additions and 22 deletions

View file

@ -6,6 +6,12 @@ the shared Iroh endpoint, resource registry, module routing, and local control
socket. Control commands connect to the Unix socket and send typed JSONL
requests.
The local metadata store is SQLite product state. `geth-store` tracks a numeric
`schema_version` in the `meta` table and applies ordered migrations up to the
crate's current schema version when the store opens. Fresh database creation and
repeated opens are idempotent; migrations that change existing schemas run in a
SQLite transaction where SQLite supports it.
Service management is also exposed through the single binary. `geth daemon
service ...` installs and controls a user-level service definition for the local
daemon. The initial backends are systemd user units on Linux, launchd user agents

View file

@ -120,12 +120,12 @@ and downstream projects.
Goal: treat local SQLite state as durable product data before users depend on
it.
- `[ ]` Replace opportunistic schema setup with ordered migrations.
- `[x]` Replace opportunistic schema setup with ordered migrations.
Acceptance criteria:
- `[ ]` The store tracks numeric schema versions.
- `[ ]` Each migration is transactional where SQLite supports it.
- `[ ]` Fresh database creation and repeated opens are idempotent.
- `[ ]` Old schema fixtures migrate to the current schema in tests.
- `[x]` The store tracks numeric schema versions.
- `[x]` Each migration is transactional where SQLite supports it.
- `[x]` Fresh database creation and repeated opens are idempotent.
- `[x]` Old schema fixtures migrate to the current schema in tests.
- `[ ]` Make multi-table writes transactional.
Acceptance criteria: