Enrolments table

The Enrolments table in the FitStack - V2 schema has 17 columns, keyed by Id, with 3 foreign keys to Sessions, GymClients and Employees.

One Student's place in one Session. Replaces ClassAttendees (81). Glossary: Enrolment; avoid Booking.

Columns (17)

Columns of the Enrolments table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null
SessionIduuidnot null, references Sessions.Id
MemberIduuidnot null, references GymClients.IdA Student is a Member with Enrolments; drop-ins are Members too (ADR 0007).
Statustextnot null`EnrolmentStatus`.
WaitlistPositionintegerSet while Waitlisted; the lowest is promoted first.
PaymentKindtextnot null`EnrolmentPaymentKind`.
PriceCentsSnapshotintegernot null
Currencycharacter varying(3)
StripePaymentIntentIdtextDropIn only.
EnrolledAttimestamp with time zonenot null
EnrolledByEmployeeIduuidreferences Employees.IdSet when staff enrolled the Member at the desk.
CancelledAttimestamp with time zone
CheckedInAttimestamp with time zone
CreatedAttimestamp with time zonenot null
ModifiedAttimestamp with time zone
IsDeletedbooleannot null
DeletedAttimestamp with time zone

Indexes (3)

  • (SessionId, MemberId) unique (IX_Enrolments_SessionId_MemberId)
  • (MemberId, EnrolledAt) (IX_Enrolments_MemberId_EnrolledAt)
  • (SessionId, Status, WaitlistPosition) (IX_Enrolments_SessionId_Status_WaitlistPosition)

Relationships