Merge pull request #65 from MagMongoing/main

Include comment statements when exporting MySQL SQL script
This commit is contained in:
lilit 2024-05-12 22:57:40 +03:00 committed by GitHub
commit 792c760eec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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) =>