Free, simple, and intuitive online database diagram editor and SQL generator.
JavaScript databasedatabase-designdatabase-diagramdatabase-schemadbmldiagram-editoreditorer-diagramerderdiagramindexeddbmariadbmcporacle-databaseoracle-dbpostgresqlschema-designsqlsql-serversqlite
Add table comment on import in mariadb and mysql (#411)
1ilit5727c629e985
diff --git a/src/utils/importSQL/mariadb.js b/src/utils/importSQL/mariadb.jsindex bdc28362..6c0b7757 100644--- a/src/utils/importSQL/mariadb.js+++ b/src/utils/importSQL/mariadb.js@@ -161,6 +161,13 @@ export function fromMariaDB(ast, diagramDb = DB.GENERIC) {}}});++ e.table_options.forEach((opt) => {+ if (opt.keyword === "comment") {+ table.comment = opt.value.replace(/^["']|["']$/g, "");+ }+ });+table.fields.forEach((f, j) => {f.id = j;});diff --git a/src/utils/importSQL/mysql.js b/src/utils/importSQL/mysql.jsindex aac8fa0a..3241bf80 100644--- a/src/utils/importSQL/mysql.js+++ b/src/utils/importSQL/mysql.js@@ -161,6 +161,13 @@ export function fromMySQL(ast, diagramDb = DB.GENERIC) {}}});++ e.table_options.forEach((opt) => {+ if (opt.keyword === "comment") {+ table.comment = opt.value.replace(/^["']|["']$/g, '');+ }+ });+table.fields.forEach((f, j) => {f.id = j;});