MealPlans table
The MealPlans table in the FitStack - V2 schema has 27 columns, keyed by Id, with 2 foreign keys to Users and Programs. 9 columns in Meals, MealPlanCategories, MealPlanDays, MealPlanDayItems and 5 more reference it.
Columns (27)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| UserId | text | not null, references Users.Id | |
| ProgramId | uuid | references Programs.Id | |
| Slug | text | not null | |
| Name | text | not null | |
| Description | text | ||
| CoverImageUrl | text | ||
| DailyCalorieTarget | numeric | not null | |
| DailyProteinTarget | numeric | not null | |
| DailyCarbTarget | numeric | not null | |
| DailyFatTarget | numeric | not null | |
| DailyFiberTarget | numeric | ||
| DailyWaterTarget | numeric | ||
| MealsPerDay | integer | ||
| TargetMealTimes | text | ||
| ShowSectionTimes | boolean | not null | |
| IsPublic | boolean | not null | |
| CurrentVersion | integer | not null | |
| PriceCents | integer | not null | |
| Currency | character varying(3) | not null | |
| IsListed | boolean | not null | |
| StripeProductId | text | ||
| StripePriceId | text | ||
| CreatedAt | timestamp with time zone | not null | |
| ModifiedAt | timestamp with time zone | ||
| IsDeleted | boolean | not null | |
| DeletedAt | timestamp with time zone |
Indexes (1)
(Slug)unique (IX_MealPlans_Slug)
Relationships
MealPlans.UserIdreferencesUsers.IdMealPlans.ProgramIdreferencesPrograms.IdMeals.MealPlanIdreferencesMealPlansMealPlanCategories.MealPlanIdreferencesMealPlansMealPlanDays.MealPlanIdreferencesMealPlansMealPlanDayItems.MealPlanIdreferencesMealPlansMealPlanFocusTags.MealPlanIdreferencesMealPlansMealPlanEnrollments.MealPlanIdreferencesMealPlansMealPlanReports.MealPlanIdreferencesMealPlansInstacartOrderRequests.MealPlanIdreferencesMealPlansNutritionLogs.MealPlanIdreferencesMealPlans