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)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| CoachId | uuid | not null, references Coaches.Id | CASCADE. |
| DayOfWeek | text | not null | Stored as TEXT — "Monday", not 0-6. |
| StartTime | time without time zone | not null | |
| EndTime | time without time zone | not null | |
| TimeZone | character varying(64) | not null | IANA id, so DST survives projection to UTC at booking time. |
| CreatedAt | timestamp with time zone | not null | |
| ModifiedAt | timestamp with time zone | ||
| IsDeleted | boolean | not null | |
| DeletedAt | timestamp with time zone |
Indexes (1)
(CoachId, DayOfWeek)(IX_CoachAvailabilities_CoachId_DayOfWeek)
Relationships
CoachAvailabilities.CoachIdreferencesCoaches.Id