diff --git a/src/utils/exportSQL/mysql.js b/src/utils/exportSQL/mysql.js index 977bf51..f8a5eff 100644 --- a/src/utils/exportSQL/mysql.js +++ b/src/utils/exportSQL/mysql.js @@ -12,7 +12,9 @@ export function toMySQL(diagram) { (field) => `${field.comment === "" ? "" : `\t-- ${field.comment}\n`}\t\`${ field.name - }\` ${field.type}${field.notNull ? " NOT NULL" : ""}${ + }\` ${field.type}${(field.size !== undefined && field.size !== "")? "(" + field.size + ")" : ""}${ + field.notNull ? " NOT NULL" : "" + }${ field.increment ? " AUTO_INCREMENT" : "" }${field.unique ? " UNIQUE" : ""}${ field.default !== ""