Files

18 lines
875 B
Markdown
Raw Permalink Normal View History

# ADR 0005 — A Plan's Steps and Supersets are stored as JSON
Status: Accepted (2026-10-29)
A Plan's items (Workout Steps, Stretching Steps and Supersets with their members) are stored as one
JSON column on the `plans` row, following CookIT's ADR 0002. A Plan is always loaded, edited and saved
as a whole, every edit is an immutable `Plan.withX` operation that can be unit-tested without a
database, and reordering or grouping into Supersets needs no position or group bookkeeping.
Plans are only listed per Mode, newest first.
## Consequences
- Items carry no ids; the editor keys rows by object identity, which is enough because every save
re-reads the Plan.
- Sessions will store a snapshot of the Plan's items (same JSON), so editing a Plan never changes
History.
- Querying across Plans by Exercise in SQL would need a table of its own; nothing needs it yet.