Skip to content

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

Include comment statements when exporting MySQL SQL script

MagMongoing3bf5eadc7030
diff --git a/src/utils/toSQL.js b/src/utils/toSQL.js
index 4720a6ef..2327bb05 100644
--- a/src/utils/toSQL.js
+++ b/src/utils/toSQL.js
@@ -181,7 +181,7 @@ export function jsonToMySQL(obj) {
)}", \`${field.name}\`))`
: ""
: ` CHECK(${field.check})`
- }`,
+ }${field.comment ? ` COMMENT '${field.comment}'` : ''}`,
)
.join(",\n")}${
table.fields.filter((f) => f.primary).length > 0
@@ -190,7 +190,7 @@ export function jsonToMySQL(obj) {
.map((f) => `\`${f.name}\``)
.join(", ")})`
: ""
- }\n);\n${
+ }\n)${table.comment ? ` COMMENT='${table.comment}'` : ''};\n${
table.indices.length > 0
? `\n${table.indices.map(
(i) =>