From f00cc289d84eab7345f9f8c52427c5fe988f43b8 Mon Sep 17 00:00:00 2001 From: mptyl Date: Tue, 11 Aug 2026 19:43:25 +0200 Subject: [PATCH] fix: mark only the referenced table PK in the DWH stub --- backend/scripts/p2-acceptance.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/scripts/p2-acceptance.mjs b/backend/scripts/p2-acceptance.mjs index ac133d7e..348b3e47 100644 --- a/backend/scripts/p2-acceptance.mjs +++ b/backend/scripts/p2-acceptance.mjs @@ -566,9 +566,9 @@ async function startServers(ctx) { column, type: inferColumnType(first[column]), nullable: false, - // `patient_id` is marked as a primary key so the same-name FK heuristic can discover - // joins from every table that carries it, giving the full-run FK checkpoint candidates. - pk: column === "id" || column === "patient_id", + // Only the referenced table marks `patient_id` as primary, so the SQL miner sees a + // PK/non-PK pair while the same-name heuristic still discovers joins from the others. + pk: column === "id" || (table === "patients" && column === "patient_id"), default: null, }))); return;