Skip to content

Free, simple, and intuitive online database diagram editor and SQL generator.

fix enum and set export syntax for mariadb

csc5309cfdecacf92e
diff --git a/src/utils/exportSQL/mariadb.js b/src/utils/exportSQL/mariadb.js
index e7f35889..9bc6117c 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 !== ""