Skip to content

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

Fix mysql field name not getting exported

1ilit6e18b6a4f14a
diff --git a/src/utils/exportSQL/mysql.js b/src/utils/exportSQL/mysql.js
index 25075235..484d4573 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) =>
- `\` ${field.type}${field.unsigned ? " UNSIGNED" : ""}${field.size !== undefined && field.size !== "" ? "(" + field.size + ")" : ""}${
+ `\t\`${field.name}\` ${field.type}${field.unsigned ? " UNSIGNED" : ""}${field.size !== undefined && field.size !== "" ? "(" + field.size + ")" : ""}${
field.notNull ? " NOT NULL" : ""
}${
field.increment ? " AUTO_INCREMENT" : ""