Skip to content

Commit

Permalink
Fix primary key assignment from out of line PK constraints in pg
Browse files Browse the repository at this point in the history
  • Loading branch information
1ilit committed Jan 3, 2025
1 parent cb9e49b commit 2704a00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/importSQL/postgres.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
Expand Down

0 comments on commit 2704a00

Please sign in to comment.