ScheduledItems table

The ScheduledItems table in the FitStack - V2 schema has 33 columns, keyed by Id, with 11 foreign keys to Users, PlanSubscriptions, ScheduleRecurrenceRules, Workouts and 7 more. 3 columns in WorkoutSessions, RunSessions and ScheduledItemLogs reference it.

50 columns and nine nullable FKs, of which at most one is set — the `ItemType` discriminator says which. Backing store for the `schedule.planned_items` data scope.

Columns (33)

Columns of the ScheduledItems table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null
UserIdtextnot null, references Users.Id
SubscriptionIduuidreferences PlanSubscriptions.Id
RecurrenceRuleIduuidreferences ScheduleRecurrenceRules.Id
ItemTypeintegernot null`ScheduleItemType`.
Statusintegernot null`ScheduleItemStatus`.
Nametextnot null
Descriptiontext
ScheduledDatedatenot null
ScheduledTimetimestamp with time zonenot null
EstimatedDurationMinutesinteger
UserTimezonetext
CompletedAttimestamp with time zone
RecurrenceInstanceinteger
MealTypeinteger
WorkoutTemplateIduuidreferences Workouts.Id
WorkoutLogIduuidreferences WorkoutLogs.Id
RecipeIduuidreferences Recipes.Id
MealIduuidreferences Meals.Id
MealLogIduuidreferences MealLogs.Id
ProductIduuidreferences Products.Id
NutritionLogIduuidreferences NutritionLogs.Id
CardioLogIduuidreferences CardioLogs.Id
SourcePlanIduuidPOLYMORPHIC — no FK.
SourcePlanTypeinteger
SourceVersioninteger
SourceWeekNumberinteger
SourceDayNumberinteger
Notestext
CreatedAttimestamp with time zonenot null
ModifiedAttimestamp with time zone
IsDeletedbooleannot null
DeletedAttimestamp with time zone

Relationships