Meals table
The Meals table in the FitStack - V2 schema has 30 columns, keyed by Id, with 4 foreign keys to MealEmbeddings, Users, MealPlans and Recipes. 6 columns in MealRatings, MealLogs, MealPlanDayItems, NutritionLogs and 2 more reference it.
Columns (30)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null, references MealEmbeddings.EntityId | |
| UserId | text | not null, references Users.Id | |
| MealPlanId | uuid | references MealPlans.Id | |
| RecipeId | uuid | references Recipes.Id | |
| Slug | text | not null | |
| Name | text | not null | |
| Description | text | ||
| Instructions | text | ||
| ImageUrl | text | ||
| MealType | integer | not null | |
| ConsumedAt | timestamp with time zone | not null | |
| ServingSize | text | ||
| TotalCalories | numeric | not null | |
| TotalProtein | numeric | not null | |
| TotalCarbohydrates | numeric | not null | |
| TotalFat | numeric | not null | |
| TotalFiber | numeric | ||
| TotalSugar | numeric | ||
| IsPublic | boolean | not null | |
| IsDraft | boolean | not null | |
| Notes | text | ||
| 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_Meals_Slug)
Relationships
Meals.IdreferencesMealEmbeddings.EntityIdMeals.UserIdreferencesUsers.IdMeals.MealPlanIdreferencesMealPlans.IdMeals.RecipeIdreferencesRecipes.IdMealRatings.MealIdreferencesMealsMealLogs.MealIdreferencesMealsMealPlanDayItems.MealIdreferencesMealsNutritionLogs.MealIdreferencesMealsFitnessPlanMealItems.MealIdreferencesMealsScheduledItems.MealIdreferencesMeals