Skip to content

Free, simple, and intuitive online database diagram editor and SQL generator.

Fix comment not getting imported issue

kavya_kunder28cfe3dace44
diff --git a/src/utils/importSQL/mariadb.js b/src/utils/importSQL/mariadb.js
index 393bae63..29a06e51 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 f74d43fd..8f3f562f 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 ecf40e86..a4fbf07e 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 88e100c2..5ff0482d 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 6c8bae9b..55e503b2 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;