-- Adds missing “userId” column to link each planned workout to its owner.
-- This mirrors the field already present in lib/db/schema.ts.

ALTER TABLE "PlannedWorkout"
ADD COLUMN "userId" uuid NOT NULL REFERENCES "User"(id);

-- Helpful for look-ups by user
CREATE INDEX IF NOT EXISTS "PlannedWorkout_userId_idx"
  ON "PlannedWorkout" ("userId");
