fix: give the patients fixture a same-name primary key column
This commit is contained in:
@@ -462,8 +462,8 @@ async function setupFixtures(ctx) {
|
||||
patients: {
|
||||
comment: "Patients",
|
||||
rows: [
|
||||
{ id: "p1", name: "Alice" },
|
||||
{ id: "p2", name: "Bob" },
|
||||
{ patient_id: "p1", name: "Alice" },
|
||||
{ patient_id: "p2", name: "Bob" },
|
||||
],
|
||||
},
|
||||
visits: {
|
||||
@@ -1169,7 +1169,7 @@ async function realChecks(ctx) {
|
||||
// approved SQL joins for candidates.
|
||||
await runThothctlJson(ctx, "preprocess-dwh-filesystem", ["workspace", "preprocess", "dwh", "--workspace", "p2-filesystem"], 0);
|
||||
const sqlPath = join(ctx.run.root, "fixtures", "p2-filesystem.sql");
|
||||
await atomicWrite(sqlPath, "SELECT v.id FROM dw.visits v JOIN dw.patients p ON v.patient_id = p.id\n");
|
||||
await atomicWrite(sqlPath, "SELECT v.id FROM dw.visits v JOIN dw.patients p ON v.patient_id = p.patient_id\n");
|
||||
const suggest = await runThothctlJson(ctx, "schema-suggest-filesystem", ["workspace", "schema", "suggest-fks", "--workspace", "p2-filesystem", "--from-sql", sqlPath], 3);
|
||||
assert(suggest.payload.code === "manual_review_required", "suggest did not block");
|
||||
assert(typeof suggest.payload.suggestedFksYaml === "string" && suggest.payload.suggestedFksYaml.length > 0, "suggested FK YAML missing");
|
||||
|
||||
Reference in New Issue
Block a user