Skip to content

Commit

Permalink
Merge pull request #65 from MagMongoing/main
Browse files Browse the repository at this point in the history
Include comment statements when exporting MySQL SQL script
  • Loading branch information
1ilit committed May 12, 2024
2 parents 0d39919 + d05ba8d commit 792c760
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/toSQL.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) =>
Expand Down

0 comments on commit 792c760

Please sign in to comment.