PlanVersions table

The PlanVersions table in the FitStack - V2 schema has 9 columns, keyed by Id, with 1 foreign key to Users.

No audit columns.

Columns (9)

Columns of the PlanVersions table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null
PlanTypeintegernot null`PlanType`.
PlanIduuidnot nullPOLYMORPHIC — no FK. Resolve via PlanType.
VersionNumberintegernot null
VersionNametext
Notestext
SnapshotDatatextFull JSON snapshot of the plan at this version.
CreatedByUserIdtextreferences Users.Id
CreatedAttimestamp with time zonenot null

Indexes (1)

  • (PlanType, PlanId, VersionNumber) unique (IX_PlanVersions_PlanType_PlanId_VersionNumber)

Relationships

  • PlanVersions.CreatedByUserId references Users.Id