Commit Graph
1 Commits
Author SHA1 Message Date
Claude c5b0896bb4 fix: dedupe foucad rows by foucode before full refresh
The source MSSQL FOUCAD table can return several rows for the same
FOUCODE, but the PostgreSQL foucad table uses foucode as PRIMARY KEY.
The bulk INSERT in fullRefresh has no conflict handling, so duplicate
FOUCODE values triggered:

  duplicate key value violates unique constraint "foucad_pkey"

Deduplicate by foucode before insert, keeping the most recently
modified row (suividatemodif). Routes join foucad 1:1 on foucode, so
one config row per supplier code is the intended shape.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011ad1qwhDEHNniSUDveTQHL
2026-06-29 06:30:00 +00:00