store: scope workout kinds and their pace/HR ranges to a user_id

workout_kinds gains a real user_id column (Task 1); workout_type_paces has
none of its own and is scoped via a join to workout_kinds instead, since
it's always accessed through a specific kind.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-25 13:44:06 +02:00
parent ef410863c6
commit e8bde134ae
4 changed files with 56 additions and 36 deletions

View File

@@ -65,7 +65,7 @@ func TestResetAllSyncedData_DeletesActivitiesCascadesAndRewindsWatermark(t *test
}
// Workout kinds (the user's taxonomy) must survive a reset.
kind, ok, err := db.GetWorkoutKind(ctx, kindID)
kind, ok, err := db.GetWorkoutKind(ctx, userID, kindID)
if err != nil || !ok {
t.Fatalf("GetWorkoutKind after reset: ok=%v err=%v", ok, err)
}