Fix primary key assignment from out of line PK constraints in pg

This commit is contained in:
1ilit 2025-01-03 20:10:50 +04:00
parent cb9e49b74c
commit 2704a007b8

View File

@ -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;
}
});