CoachStatusEvents table
The CoachStatusEvents table in the FitStack - V2 schema has 7 columns, keyed by Id, with 2 foreign keys to Coaches and Users.
v2 ADD. Append-only history of the approval workflow. v1 kept only the latest decision on the Coach row (`ApprovedAt`, `RejectionReason`), so a coach approved, suspended, then reinstated left no trace of the suspension — unanswerable in a dispute. No audit columns: this table IS the audit.
Columns (7)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| CoachId | uuid | not null, references Coaches.Id | CASCADE. |
| FromStatus | text | `CoachStatus`. Null on the first event. | |
| ToStatus | text | not null | `CoachStatus`. |
| ActorUserId | text | references Users.Id | Null when the system moved it. |
| Reason | character varying(2000) | ||
| OccurredAt | timestamp with time zone | not null |
Indexes (1)
(CoachId, OccurredAt)(IX_CoachStatusEvents_CoachId_OccurredAt)
Relationships
CoachStatusEvents.CoachIdreferencesCoaches.IdCoachStatusEvents.ActorUserIdreferencesUsers.Id