PlannedSession has no userId #176

Open
opened 2026-11-08 18:18:05 +00:00 by chris-kreidl · 1 comment
chris-kreidl commented 2026-11-08 18:18:05 +00:00 (Migrated from github.com)

PlannedSession has no userId, so ownership checks and date queries join through Mesocycle → PlanVersion → Plan. Denormalise userId there if the joins get hot.

Moved from docs/PROGRESS.md → Follow-ups → Later on 2026-11-08.

`PlannedSession` has no `userId`, so ownership checks and date queries join through Mesocycle → PlanVersion → Plan. Denormalise `userId` there if the joins get hot. _Moved from docs/PROGRESS.md → Follow-ups → Later on 2026-11-08._
chris-kreidl commented 2026-11-08 20:17:11 +00:00 (Migrated from github.com)

What this is about. A planned session (PlannedSession) doesn't store its owner. Checking that a session is yours, or querying sessions by date, joins through Mesocycle → PlanVersion → Plan to reach userId.

Status (checked 2026-11-08): unchanged.

When it matters: only if those queries get slow. Session 49 (#224) times its History queries on real data, which would show it. Adding a column is an additive migration, so it's safe to do later.

**What this is about.** A planned session (`PlannedSession`) doesn't store its owner. Checking that a session is yours, or querying sessions by date, joins through Mesocycle → PlanVersion → Plan to reach `userId`. **Status (checked 2026-11-08):** unchanged. **When it matters:** only if those queries get slow. Session 49 (#224) times its History queries on real data, which would show it. Adding a column is an additive migration, so it's safe to do later.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ckreidl/trainer#176
No description provided.