From 28cfe3dace44c2b0e2ff8d00abeae1e249a5165f Mon Sep 17 00:00:00 2001 From: kavya_kunder Date: Sun, 18 Aug 2024 01:42:04 +0530 Subject: [PATCH] Fix comment not getting imported issue --- src/utils/importSQL/mariadb.js | 2 +- src/utils/importSQL/mssql.js | 2 +- src/utils/importSQL/mysql.js | 2 +- src/utils/importSQL/postgres.js | 2 +- src/utils/importSQL/sqlite.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/importSQL/mariadb.js b/src/utils/importSQL/mariadb.js index 393bae6..29a06e5 100644 --- a/src/utils/importSQL/mariadb.js +++ b/src/utils/importSQL/mariadb.js @@ -47,7 +47,7 @@ export function fromMariaDB(ast, diagramDb = DB.GENERIC) { if (d.definition.expr && d.definition.expr.type === "expr_list") { field.values = d.definition.expr.value.map((v) => v.value); } - field.comment = ""; + field.comment = d.comment ? d.comment.value.value : ""; field.unique = false; if (d.unique) field.unique = true; field.increment = false; diff --git a/src/utils/importSQL/mssql.js b/src/utils/importSQL/mssql.js index f74d43f..8f3f562 100644 --- a/src/utils/importSQL/mssql.js +++ b/src/utils/importSQL/mssql.js @@ -59,7 +59,7 @@ export function fromMSSQL(ast, diagramDb = DB.GENERIC) { if (d.definition.expr && d.definition.expr.type === "expr_list") { field.values = d.definition.expr.value.map((v) => v.value); } - field.comment = ""; + field.comment = d.comment ? d.comment.value.value : ""; field.unique = false; if (d.unique) field.unique = true; field.increment = false; diff --git a/src/utils/importSQL/mysql.js b/src/utils/importSQL/mysql.js index ecf40e8..a4fbf07 100644 --- a/src/utils/importSQL/mysql.js +++ b/src/utils/importSQL/mysql.js @@ -47,7 +47,7 @@ export function fromMySQL(ast, diagramDb = DB.GENERIC) { if (d.definition.expr && d.definition.expr.type === "expr_list") { field.values = d.definition.expr.value.map((v) => v.value); } - field.comment = ""; + field.comment = d.comment ? d.comment.value.value : ""; field.unique = false; if (d.unique) field.unique = true; field.increment = false; diff --git a/src/utils/importSQL/postgres.js b/src/utils/importSQL/postgres.js index 88e100c..5ff0482 100644 --- a/src/utils/importSQL/postgres.js +++ b/src/utils/importSQL/postgres.js @@ -47,7 +47,7 @@ export function fromPostgres(ast, diagramDb = DB.GENERIC) { if (d.definition.expr && d.definition.expr.type === "expr_list") { field.values = d.definition.expr.value.map((v) => v.value); } - field.comment = ""; + field.comment = d.comment ? d.comment.value.value : ""; field.unique = false; if (d.unique) field.unique = true; field.increment = false; diff --git a/src/utils/importSQL/sqlite.js b/src/utils/importSQL/sqlite.js index 6c8bae9..55e503b 100644 --- a/src/utils/importSQL/sqlite.js +++ b/src/utils/importSQL/sqlite.js @@ -64,7 +64,7 @@ export function fromSQLite(ast, diagramDb = DB.GENERIC) { if (d.definition.expr && d.definition.expr.type === "expr_list") { field.values = d.definition.expr.value.map((v) => v.value); } - field.comment = ""; + field.comment = d.comment ? d.comment.value.value : ""; field.unique = false; if (d.unique) field.unique = true; field.increment = false;