Implementing idempotent digest upserts with onConflictDoUpdate
Drizzle ORM onConflictDoUpdate requires the target columns to have a unique index defined in the schema — passing arbitrary column arrays without a matching uniqueIndex will silently fail at runtime with a Postgres error. Define the unique constraint in your schema first.