Products table
The Products table in the FitStack - V2 schema has 23 columns, keyed by Id, with 2 foreign keys to Branding and Nutrition. 12 columns in MealLogIngredients, MealPlanDayItems, NutritionLogs, ScheduledItems and 8 more reference it.
Columns (23)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| Slug | character varying(160) | not null | |
| DataSource | character varying(50) | not null | |
| NutriScoreGrade | character varying(10) | not null | |
| BrandingId | uuid | references Branding.Id | |
| NutritionId | uuid | references Nutrition.Id | |
| CurrentVersion | integer | not null | |
| DataQualityScore | numeric(5,2) | ||
| QualityTier | text | ||
| NutritionVerified | boolean | not null | |
| IngredientsVerified | boolean | not null | |
| BrandingVerified | boolean | not null | |
| BarcodeVerified | boolean | not null | |
| IsVerified | boolean | not null | |
| Countries | text[] | not null | |
| Country | character varying(80) | ||
| Language | character varying(8) | ||
| LastEditedByUserId | character varying(450) | ||
| PendingAnnotatorReview | boolean | not null | |
| CreatedAt | timestamp with time zone | not null | |
| ModifiedAt | timestamp with time zone | ||
| IsDeleted | boolean | not null | |
| DeletedAt | timestamp with time zone |
Indexes (7)
(Slug)unique (IX_Products_Slug)(BrandingId)unique (IX_Products_BrandingId)(NutritionId)unique (IX_Products_NutritionId)(Country)(IX_Products_Country)(Language)(IX_Products_Language)(LastEditedByUserId)(IX_Products_LastEditedByUserId)(PendingAnnotatorReview)(IX_Products_PendingAnnotatorReview)
Relationships
Products.BrandingIdreferencesBranding.IdProducts.NutritionIdreferencesNutrition.IdMealLogIngredients.ProductIdreferencesProductsMealPlanDayItems.ProductIdreferencesProductsNutritionLogs.ProductIdreferencesProductsScheduledItems.ProductIdreferencesProductsBarcodes.ProductIdreferencesProductsProductImages.ProductIdreferencesProductsProductIngredients.ProductIdreferencesProductsProductVersions.ProductIdreferencesProductsProductValidationIssues.ProductIdreferencesProductsProductAnnotations.ProductIdreferencesProductsProductReviews.ProductIdreferencesProductsProductSessions.ProductIdreferencesProducts