Skip to content

Seed built-in exercise catalog - #63

Merged
rd-code-23 merged 1 commit into
mainfrom
feature/builtin-exercise-seed
Aug 24, 2026
Merged

rd-code-23 merged 1 commit into
mainfrom
feature/builtin-exercise-seed

Conversation

@rd-code-23

Copy link
Copy Markdown
Owner

Problem

Routine creation requires an initial catalog of built-in exercises in every environment. Schema migrations create the exercise table, but a new developer, test environment, or deployment would otherwise start with no selectable exercises.

What changed

  • Added custom data migration 0006_seed_builtin_exercises.sql.
  • Added five MVP exercises approved in the product requirements:
    • Bicep Curl
    • Hammer Curl
    • Tricep Extension
    • Overhead Press
    • Lateral Raise
  • Assigned stable UUIDs to each built-in exercise.
  • Recorded the custom migration in Drizzle metadata.

Why a migration

The built-in catalog is required application reference data rather than optional demo content. Installing it through the normal migration sequence ensures that new developer, test, staging, and production databases receive the same baseline data without requiring a separate seed command that can be forgotten.

Future catalog additions should use new migrations rather than editing this applied migration.

Idempotency

The migration inserts records by stable UUID and uses ON CONFLICT (id) DO UPDATE. Reapplying its SQL cannot create duplicate built-ins.

The update is conditional: it runs only if the ownership marker or canonical name differs. Therefore, repeating the SQL without a real difference does not unnecessarily change updated_at.

The upsert intentionally does not overwrite descriptions, allowing instructional content to be added separately later.

Ownership

Every built-in exercise uses owner_user_id = NULL, matching the documented ownership model. No custom-user exercises are created.

Scope

This PR implements only #62. It does not add descriptions, exercise images, CRUD endpoints, custom exercise creation, routine contracts, or routine UI.

Verification

  • pnpm --filter @goforlift/api typecheck
  • pnpm --filter @goforlift/api test — 48 tests passed
  • pnpm --filter @goforlift/api lint
  • pnpm --filter @goforlift/api db:generate — no schema changes detected
  • Prettier check for generated metadata
  • git diff --check

The migration is committed but was not applied to a developer's local PostgreSQL database as part of this PR.

Closes #62

@rd-code-23
rd-code-23 merged commit acdffad into main Aug 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Routines][Phase 1] Seed built-in exercise catalog

1 participant