fix: moved rpe to sets rather than workouts

This commit is contained in:
2026-08-29 15:21:17 +02:00
parent 62b3863257
commit 06846c611d
@@ -71,7 +71,6 @@ CREATE TABLE workouts (
template_id UUID REFERENCES templates(id) ON DELETE SET NULL, template_id UUID REFERENCES templates(id) ON DELETE SET NULL,
started_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), started_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
ended_at TIMESTAMPTZ, ended_at TIMESTAMPTZ,
rpe smallint CHECK (rpe BETWEEN 1 AND 10),
notes TEXT, notes TEXT,
modified_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), modified_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
deleted_at TIMESTAMPTZ deleted_at TIMESTAMPTZ
@@ -88,6 +87,7 @@ CREATE TABLE workout_sets (
reps SMALLINT, reps SMALLINT,
seconds SMALLINT, seconds SMALLINT,
weight_kg NUMERIC(5,2), weight_kg NUMERIC(5,2),
rpe SMALLINT CHECK (rpe BETWEEN 1 AND 10),
type TEXT NOT NULL DEFAULT 'working' type TEXT NOT NULL DEFAULT 'working'
CHECK (type IN ('warm-up', 'working', 'drop')), CHECK (type IN ('warm-up', 'working', 'drop')),
note TEXT, note TEXT,