Workouts table
The Workouts table in the FitStack - V2 schema has 23 columns, keyed by Id, with 4 foreign keys to WorkoutEmbeddings, Users, Programs and Media. 6 columns in WorkoutBlockTemplates, ProgramWorkouts, WorkoutLogs, WorkoutSessions and 2 more reference it.
The marketplace columns (PriceCents..StripePriceId) repeat identically on Programs, Meals, MealPlans and FitnessPlans — see 52.
Columns (23)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null, references WorkoutEmbeddings.EntityId | |
| Name | text | not null | |
| Description | text | not null | |
| Slug | character varying(160) | not null | Assigned at SaveChanges by Persistence/Services/SlugFallback.cs. |
| CreatedById | text | not null, references Users.Id | |
| ProgramId | uuid | references Programs.Id | |
| ImageId | uuid | references Media.Id | |
| EstimatedDuration | interval | not null | |
| DifficultyLevel | integer | not null | |
| IsPublic | boolean | not null | |
| IsVerified | boolean | not null | |
| OrderInProgram | integer | ||
| IsSnapshot | boolean | not null | A frozen copy taken when a program version was published. |
| OriginalWorkoutId | uuid | Points at the source when IsSnapshot. No FK. | |
| PriceCents | integer | not null | |
| Currency | character varying(3) | not null | |
| IsListed | boolean | not null | |
| StripeProductId | text | ||
| StripePriceId | text | ||
| CreatedAt | timestamp with time zone | not null | |
| ModifiedAt | timestamp with time zone | ||
| IsDeleted | boolean | not null | |
| DeletedAt | timestamp with time zone |
Indexes (1)
(Slug)unique (IX_Workouts_Slug)
Relationships
Workouts.IdreferencesWorkoutEmbeddings.EntityIdWorkouts.CreatedByIdreferencesUsers.IdWorkouts.ProgramIdreferencesPrograms.IdWorkouts.ImageIdreferencesMedia.IdWorkoutBlockTemplates.WorkoutIdreferencesWorkoutsProgramWorkouts.WorkoutIdreferencesWorkoutsWorkoutLogs.WorkoutTemplateIdreferencesWorkoutsWorkoutSessions.WorkoutIdreferencesWorkoutsFitnessPlanWorkoutItems.WorkoutIdreferencesWorkoutsScheduledItems.WorkoutTemplateIdreferencesWorkouts