PlanSubscriptions table
The PlanSubscriptions table in the FitStack - V2 schema has 22 columns, keyed by Id, with 2 foreign keys to Users. 1 column in ScheduledItems references it.
A user following a plan. Distinct from `PlanPurchases` (52), which is the money.
Columns (22)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| UserId | text | not null, references Users.Id | |
| SharedByUserId | text | references Users.Id | |
| PlanType | integer | not null | |
| PlanId | uuid | not null | POLYMORPHIC — no FK. |
| Status | integer | not null | `PlanSubscriptionStatus`. |
| SubscribedAt | timestamp with time zone | not null | |
| StartDate | date | not null | |
| EndDate | date | ||
| SubscribedVersion | integer | not null | |
| AutoSyncToLatest | boolean | not null | |
| LastSyncedVersion | integer | ||
| CurrentWeekNumber | integer | ||
| CurrentDayNumber | integer | ||
| UserTimezone | text | ||
| NotificationsEnabled | boolean | not null | |
| GenerateAheadDays | integer | not null | |
| IsShared | boolean | not null | |
| CreatedAt | timestamp with time zone | not null | |
| ModifiedAt | timestamp with time zone | ||
| IsDeleted | boolean | not null | |
| DeletedAt | timestamp with time zone |
Relationships
PlanSubscriptions.UserIdreferencesUsers.IdPlanSubscriptions.SharedByUserIdreferencesUsers.IdScheduledItems.SubscriptionIdreferencesPlanSubscriptions