From 935900d32bd5181496e9a0268e03c8fafcfb9d12 Mon Sep 17 00:00:00 2001 From: 1ilit <1ilit@proton.me> Date: Sat, 28 Sep 2024 16:48:48 +0400 Subject: [PATCH] Fix import from alter statements failing --- src/utils/importSQL/postgres.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/importSQL/postgres.js b/src/utils/importSQL/postgres.js index 1a0ba2a1..2912404c 100644 --- a/src/utils/importSQL/postgres.js +++ b/src/utils/importSQL/postgres.js @@ -282,11 +282,13 @@ export function fromPostgres(ast, diagramDb = DB.GENERIC) { ) { const relationship = {}; const startTable = e.table[0].table; - const startField = expr.create_definitions.definition[0].column; + const startField = + expr.create_definitions.definition[0].column.expr.value; const endTable = expr.create_definitions.reference_definition.table[0].table; const endField = - expr.create_definitions.reference_definition.definition[0].column; + expr.create_definitions.reference_definition.definition[0].column + .expr.value; let updateConstraint = "No action"; let deleteConstraint = "No action"; expr.create_definitions.reference_definition.on_action.forEach(