v1.0.0:5 — remove caloriesBurned raw-SQL workaround

The three exported helpers in lib/prisma.ts (getCaloriesBurned,
setCaloriesBurned, getCaloriesBurnedBulk) existed because an early
Prisma client generation didn't include the column. Schema and
client have been aligned for several releases — the workaround is
dead weight.

Removed: the helpers from lib/prisma.ts (~30 lines of
$queryRawUnsafe / $executeRawUnsafe).

Updated callers to use plain caloriesBurned field references:
- app/api/workouts/route.ts (GET list + POST create)
- app/api/workouts/[id]/route.ts (GET detail + PATCH update)
- app/api/settings/export-csv/route.ts (CSV export)

All call sites now go through normal type-safe Prisma queries.
Net effect for users: zero. Net effect for the codebase: cleaner
read paths, stronger TS coverage on caloriesBurned, fewer SQL
strings to audit.

No schema changes, no migration. Existing /data is untouched.

v1.0.0:5 promoted to current; :1, :2, :3, :4 in other.
This commit is contained in:
Keysat
2026-05-09 19:42:45 -05:00
parent 5f7b3b6b7a
commit dc6a3b1116
6 changed files with 54 additions and 98 deletions
+10 -11
View File
@@ -3,25 +3,24 @@ import { v_1_0_0_1 } from './v1.0.0.1'
import { v_1_0_0_2 } from './v1.0.0.2'
import { v_1_0_0_3 } from './v1.0.0.3'
import { v_1_0_0_4 } from './v1.0.0.4'
import { v_1_0_0_5 } from './v1.0.0.5'
/**
* Version graph for the `proof-of-work` package.
*
* v1.0.0:1 — initial release, seeded cutover from the legacy
* `workout-log` package.
* v1.0.0:2 — CSP fix (reverted the over-strict nonce-based CSP that
* broke first paint in v1.0.0:1).
* v1.0.0:3post-cutover seed strip (baked /data snapshot removed
* from the image now that the cutover is verified done).
* v1.0.0:4removes the default admin@local / workout123 credentials
* from fresh installs. Operator must run the StartOS Action
* "Set admin credentials" before login is possible.
* v1.0.0:2 — CSP fix.
* v1.0.0:3 — post-cutover seed strip.
* v1.0.0:4removes the default admin@local credentials; operator
* must run the StartOS Action to bootstrap the first admin.
* v1.0.0:5internal cleanup (removes caloriesBurned raw-SQL
* workaround). No user-facing change.
*
* StartOS picks `current` as the install target; `other` lists every
* node that can upgrade into `current`. Hosts on v1.0.0:1, :2, or :3
* upgrade to :4 via no-op up migrations; fresh installs land on :4.
* node that can upgrade into `current`.
*/
export const versionGraph = VersionGraph.of({
current: v_1_0_0_4,
other: [v_1_0_0_1, v_1_0_0_2, v_1_0_0_3],
current: v_1_0_0_5,
other: [v_1_0_0_1, v_1_0_0_2, v_1_0_0_3, v_1_0_0_4],
})