From 2704a007b8269292a6850e10c219be1669018160 Mon Sep 17 00:00:00 2001 From: 1ilit <1ilit@proton.me> Date: Fri, 3 Jan 2025 20:10:50 +0400 Subject: [PATCH] Fix primary key assignment from out of line PK constraints in pg --- src/utils/importSQL/postgres.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/importSQL/postgres.js b/src/utils/importSQL/postgres.js index 77ba39b..3ac7a4b 100644 --- a/src/utils/importSQL/postgres.js +++ b/src/utils/importSQL/postgres.js @@ -102,7 +102,7 @@ export function fromPostgres(ast, diagramDb = DB.GENERIC) { if (d.constraint_type === "primary key") { d.definition.forEach((c) => { table.fields.forEach((f) => { - if (f.name === c.column && !f.primary) { + if (f.name === c.column.expr.value && !f.primary) { f.primary = true; } });