diff --git a/src/utils/exportSQL/mariadb.js b/src/utils/exportSQL/mariadb.js index e7f3588..b1cc3af 100644 --- a/src/utils/exportSQL/mariadb.js +++ b/src/utils/exportSQL/mariadb.js @@ -11,7 +11,7 @@ export function toMariaDB(diagram) { (field) => `\t\`${ field.name - }\` ${field.type}${field.unsigned ? " UNSIGNED" : ""}${field.notNull ? " NOT NULL" : ""}${ + }\` ${field.type}${field.values ? "(" + field.values.map((value) => "'" + value + "'").join(", ") + ")" : ""}${field.unsigned ? " UNSIGNED" : ""}${field.notNull ? " NOT NULL" : ""}${ field.increment ? " AUTO_INCREMENT" : "" }${field.unique ? " UNIQUE" : ""}${ field.default !== "" diff --git a/src/utils/exportSQL/mysql.js b/src/utils/exportSQL/mysql.js index 484d457..e1228d4 100644 --- a/src/utils/exportSQL/mysql.js +++ b/src/utils/exportSQL/mysql.js @@ -9,7 +9,7 @@ export function toMySQL(diagram) { `CREATE TABLE \`${table.name}\` (\n${table.fields .map( (field) => - `\t\`${field.name}\` ${field.type}${field.unsigned ? " UNSIGNED" : ""}${field.size !== undefined && field.size !== "" ? "(" + field.size + ")" : ""}${ + `\t\`${field.name}\` ${field.type}${field.values ? "(" + field.values.map((value) => "'" + value + "'").join(", ") + ")" : ""}${field.unsigned ? " UNSIGNED" : ""}${field.size !== undefined && field.size !== "" ? "(" + field.size + ")" : ""}${ field.notNull ? " NOT NULL" : "" }${ field.increment ? " AUTO_INCREMENT" : ""