Skip to content

Commit 2704a00

Browse files
committed
Fix primary key assignment from out of line PK constraints in pg
1 parent cb9e49b commit 2704a00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/importSQL/postgres.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function fromPostgres(ast, diagramDb = DB.GENERIC) {
102102
if (d.constraint_type === "primary key") {
103103
d.definition.forEach((c) => {
104104
table.fields.forEach((f) => {
105-
if (f.name === c.column && !f.primary) {
105+
if (f.name === c.column.expr.value && !f.primary) {
106106
f.primary = true;
107107
}
108108
});

0 commit comments

Comments
 (0)