Skip to content

Data repair: existing meal_components rows saved with per-portion base_* values #19

Description

@KrishP147

Follow-up from #6. Before #6, PhotoMealUpload.saveMeal wrote base_* per Gemini portion (base_portion_size g) instead of per 100 g, and search selections with quantity>1 wrote base_* multiplied by quantity with portion_size=100.

  • Photo rows CAN be repaired: base_portion_size is stored, so base_* = base_* * 100 / base_portion_size where base_portion_size != 100.
  • Search rows CANNOT be derived (quantity was not stored); at most flag them.

Deliverable: backend/migrations/0XX_repair_meal_components_base.sql (idempotent, guarded), documented as manual-apply in docs/02-database-setup.md; never run from CI.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions