fix: add missing $27 placeholder for traces column in bulk food import#1427
Conversation
The createFoodsInBulk INSERT INTO food_variants query listed 29 target columns (including 'traces') but only provided 28 value expressions ($1–$26 + now() + now()), causing a PostgreSQL error: 'INSERT a plus de colonnes cibles que d expressions' Add the missing $27 placeholder so the parameter array (which already supplies variant.traces as the 27th element) is correctly bound.
PR Validation ResultsChange Detection
|
There was a problem hiding this comment.
Code Review
This pull request updates the SQL query within the createFoodsInBulk function in SparkyFitnessServer/models/food.ts to include an additional parameter placeholder ($27) in the VALUES clause, ensuring the query matches the number of columns being inserted. There are no review comments, and I have no further feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Thanks for your PR. The table previously had user_id which was removed in the previous PR. It could be the culprit . |
Description
What problem does this PR solve?
The
createFoodsInBulkINSERT query forfood_variantslisted 29 target columns but only 28 value expressions, causing PostgreSQL error: INSERT a plus de colonnes cibles que d expressions.How did you implement the solution?
Added the missing
$27placeholder for thetracescolumn in the VALUES clause.Linked Issue: N/A (bug found during usage)
How to Test
pnpm run validateinSparkyFitnessServer/PR Type
Checklist
All PRs:
Backend changes (
SparkyFitnessServer/):rls_policies.sqlfor any new user-specific tables.Notes for Reviewers