CourseSchedules table

The CourseSchedules table in the FitStack - V2 schema has 12 columns, keyed by Id, with 3 foreign keys to Courses, Studios and Trainers. 1 column in Sessions references it.

The timetable rule. A job materialises Sessions 8 weeks ahead; editing a rule regenerates Sessions from a date forward, keeping those with Enrolments.

Columns (12)

Columns of the CourseSchedules table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null
CourseIduuidnot null, references Courses.IdCASCADE.
DaysOfWeekintegernot nullBITMASK of DayOfWeekFlags, as ScheduleRecurrenceRules (50): Mon 1, Tue 2, Wed 4, Thu 8, Fri 16, Sat 32, Sun 64.
StartTimetimenot nullLocal to Gyms.Timezone.
StudioIduuidreferences Studios.IdOverrides Courses.DefaultStudioId.
TrainerIduuidreferences Trainers.IdOverrides Courses.DefaultTrainerId.
StartDatedatenot null
EndDatedateNull = open-ended.
CreatedAttimestamp with time zonenot null
ModifiedAttimestamp with time zone
IsDeletedbooleannot null
DeletedAttimestamp with time zone

Indexes (1)

  • (CourseId) (IX_CourseSchedules_CourseId)

Relationships