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)

Columns of the CoachStatusEvents table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null
CoachIduuidnot null, references Coaches.IdCASCADE.
FromStatustext`CoachStatus`. Null on the first event.
ToStatustextnot null`CoachStatus`.
ActorUserIdtextreferences Users.IdNull when the system moved it.
Reasoncharacter varying(2000)
OccurredAttimestamp with time zonenot null

Indexes (1)

  • (CoachId, OccurredAt) (IX_CoachStatusEvents_CoachId_OccurredAt)

Relationships

  • CoachStatusEvents.CoachId references Coaches.Id
  • CoachStatusEvents.ActorUserId references Users.Id