Skip to content

Commit 792c760

Browse files
authored
Merge pull request #65 from MagMongoing/main
Include comment statements when exporting MySQL SQL script
2 parents 0d39919 + d05ba8d commit 792c760

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/toSQL.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export function jsonToMySQL(obj) {
181181
)}", \`${field.name}\`))`
182182
: ""
183183
: ` CHECK(${field.check})`
184-
}`,
184+
}${field.comment ? ` COMMENT '${field.comment}'` : ''}`,
185185
)
186186
.join(",\n")}${
187187
table.fields.filter((f) => f.primary).length > 0
@@ -190,7 +190,7 @@ export function jsonToMySQL(obj) {
190190
.map((f) => `\`${f.name}\``)
191191
.join(", ")})`
192192
: ""
193-
}\n);\n${
193+
}\n)${table.comment ? ` COMMENT='${table.comment}'` : ''};\n${
194194
table.indices.length > 0
195195
? `\n${table.indices.map(
196196
(i) =>

0 commit comments

Comments
 (0)