Files
geniusrun/backend/internal/store/migrations/0008_workout_targets.sql

13 lines
718 B
MySQL
Raw Normal View History

-- Structured Garmin workouts (created in Garmin Connect or a training plan
-- tool) attach a per-step target pace/HR zone. An activity recorded from one
-- carries that workout's id; when its laps line up 1:1 with the workout's
-- flattened steps (see internal/sync's alignWorkoutTargets), the expected
-- band is resolved and stored per lap so the Review Queue can plot expected
-- vs actual pace/HR without a live Garmin call on every page view.
ALTER TABLE activities ADD COLUMN workout_id INTEGER;
ALTER TABLE laps ADD COLUMN target_pace_low_mps REAL;
ALTER TABLE laps ADD COLUMN target_pace_high_mps REAL;
ALTER TABLE laps ADD COLUMN target_hr_low_bpm REAL;
ALTER TABLE laps ADD COLUMN target_hr_high_bpm REAL;