Coaches table
The Coaches table in the FitStack - V2 schema has 18 columns, keyed by Id, with 3 foreign keys to Trainers, Media and Users. 14 columns in Users, CoachStatusEvents, CoachCertifications, CoachSpecialtyTags and 10 more reference it.
One row per user who coaches. `UserId` is unique, so coaching is a facet of an account, not a separate account. **Status is a gate, not a label.** Only `Approved` may hold active clients or hold data-access grants. Suspending a coach must cascade to `CoachAccessGrants` (62) — otherwise a suspended coach keeps reading client health data, which is exactly the failure the consent model exists to prevent. Reintroducing this domain also needs a `Coach` entry in the `UserType` enum; ordinal 7 was vacated by the removal migration. See 00-conventions.
Columns (18)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null, references Trainers.CoachId | |
| UserId | text | not null | v2 FIX: a real FK. In v1 this was a dangling `text` column with no constraint, so a coach could outlive its user. |
| Status | text | not null | `CoachStatus`. |
| Headline | character varying(140) | ||
| Bio | character varying(4000) | ||
| HourlyRateUsd | numeric(10,2) | ||
| HeroMediaId | uuid | references Media.Id | v2 FIX: real FK. Was a loose uuid. |
| TimeZone | character varying(64) | not null | v2 ADD: IANA id. v1 stored a timezone per availability row, so a coach with no availability had no timezone at all. |
| AcceptingNewClients | boolean | not null | v2 ADD: BrowseCoaches filtered on a field that did not exist. |
| MaxActiveClients | integer | v2 ADD: null = unlimited. Enforced in the app; see CoachClients. | |
| SubmittedForReviewAt | timestamp with time zone | ||
| ApprovedByUserId | text | references Users.Id | v2 FIX: real FK. |
| ApprovedAt | timestamp with time zone | ||
| RejectionReason | character varying(2000) | ||
| CreatedAt | timestamp with time zone | not null | |
| ModifiedAt | timestamp with time zone | ||
| IsDeleted | boolean | not null | |
| DeletedAt | timestamp with time zone |
Indexes (3)
(UserId)unique (IX_Coaches_UserId)(Status)(IX_Coaches_Status)(Status, AcceptingNewClients)(IX_Coaches_Status_AcceptingNewClients)
Relationships
Coaches.IdreferencesTrainers.CoachIdCoaches.HeroMediaIdreferencesMedia.IdCoaches.ApprovedByUserIdreferencesUsers.IdUsers.IdreferencesCoachesCoachStatusEvents.CoachIdreferencesCoachesCoachCertifications.CoachIdreferencesCoachesCoachSpecialtyTags.CoachIdreferencesCoachesCoachAvailabilities.CoachIdreferencesCoachesCoachInvitations.CoachIdreferencesCoachesCoachClients.CoachIdreferencesCoachesCoachAccessRequests.CoachIdreferencesCoachesCoachAccessGrants.CoachIdreferencesCoachesCoachDataAccessLogs.CoachIdreferencesCoachesCoachAssignments.CoachIdreferencesCoachesCoachAppointments.CoachIdreferencesCoachesCoachOfferings.CoachIdreferencesCoachesGymCoaches.CoachIdreferencesCoaches