Courses table
The Courses table in the FitStack - V2 schema has 21 columns, keyed by Id, with 4 foreign keys to Gyms, Studios, Trainers and Media. 3 columns in CourseSchedules, Sessions and CoursePrices reference it.
The template Sessions are made from. Glossary: Course; avoid Class.
Columns (21)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| GymId | uuid | not null, references Gyms.Id | |
| Name | character varying(200) | not null | |
| Description | character varying(4000) | ||
| Category | character varying(100) | Free text with suggestions: Yoga, HIIT, Spin, Strength ... | |
| DefaultStudioId | uuid | references Studios.Id | |
| DefaultTrainerId | uuid | references Trainers.Id | |
| DurationMinutes | integer | not null | |
| Capacity | integer | Null = the Studio's capacity. | |
| DropInPriceCents | integer | Null = no drop-ins; Membership only. | |
| Currency | character varying(3) | not null | |
| IncludedInMembership | boolean | not null | |
| LateCancelHours | integer | not null | Cancelling inside this window counts as LateCancelled. |
| NoShowFeeCents | integer | ||
| WaitlistEnabled | boolean | not null | |
| ImageMediaId | uuid | references Media.Id | |
| Status | text | not null | `CourseStatus`. |
| CreatedAt | timestamp with time zone | not null | |
| ModifiedAt | timestamp with time zone | ||
| IsDeleted | boolean | not null | |
| DeletedAt | timestamp with time zone |
Indexes (1)
(GymId, Status)(IX_Courses_GymId_Status)
Relationships
Courses.GymIdreferencesGyms.IdCourses.DefaultStudioIdreferencesStudios.IdCourses.DefaultTrainerIdreferencesTrainers.IdCourses.ImageMediaIdreferencesMedia.IdCourseSchedules.CourseIdreferencesCoursesSessions.CourseIdreferencesCoursesCoursePrices.CourseIdreferencesCourses