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)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| PlanType | integer | not null | `PlanType`. |
| PlanId | uuid | not null | POLYMORPHIC — no FK. Resolve via PlanType. |
| VersionNumber | integer | not null | |
| VersionName | text | ||
| Notes | text | ||
| SnapshotData | text | Full JSON snapshot of the plan at this version. | |
| CreatedByUserId | text | references Users.Id | |
| CreatedAt | timestamp with time zone | not null |
Indexes (1)
(PlanType, PlanId, VersionNumber)unique (IX_PlanVersions_PlanType_PlanId_VersionNumber)
Relationships
PlanVersions.CreatedByUserIdreferencesUsers.Id