CoachAvailabilities table

The CoachAvailabilities table in the FitStack - V2 schema has 10 columns, keyed by Id, with 1 foreign key to Coaches.

One recurring weekly window. Times are the coach local wall clock. v2 ADD — needs a CHECK constraint DBML cannot express: `CONSTRAINT CK_CoachAvailabilities_TimeOrder CHECK ("StartTime" < "EndTime")`. v1 happily stored 17:00-09:00, which `GetAvailableSlots` rendered as an empty day with no error.

Columns (10)

Columns of the CoachAvailabilities table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null
CoachIduuidnot null, references Coaches.IdCASCADE.
DayOfWeektextnot nullStored as TEXT — "Monday", not 0-6.
StartTimetime without time zonenot null
EndTimetime without time zonenot null
TimeZonecharacter varying(64)not nullIANA id, so DST survives projection to UTC at booking time.
CreatedAttimestamp with time zonenot null
ModifiedAttimestamp with time zone
IsDeletedbooleannot null
DeletedAttimestamp with time zone

Indexes (1)

  • (CoachId, DayOfWeek) (IX_CoachAvailabilities_CoachId_DayOfWeek)

Relationships

  • CoachAvailabilities.CoachId references Coaches.Id