We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9536677 commit 7db4cc7Copy full SHA for 7db4cc7
src/utils/exportSQL/mysql.js
@@ -2,6 +2,8 @@ import { dbToTypes } from "../../data/datatypes";
2
import { parseDefault } from "./shared";
3
4
export function toMySQL(diagram) {
5
+ console.log(diagram);
6
+ // console.log(mysqlTypes[field.type.toString()]);
7
return `${diagram.tables
8
.map(
9
(table) =>
@@ -12,7 +14,9 @@ export function toMySQL(diagram) {
12
14
(field) =>
13
15
`${field.comment === "" ? "" : `\t-- ${field.comment}\n`}\t\`${
16
field.name
- }\` ${field.type}${field.notNull ? " NOT NULL" : ""}${
17
+ }\` ${field.type}${(field.size !== undefined && field.size !== "")? "(" + field.size + ")" : ""}${
18
+ field.notNull ? " NOT NULL" : ""
19
+ }${
20
field.increment ? " AUTO_INCREMENT" : ""
21
}${field.unique ? " UNIQUE" : ""}${
22
field.default !== ""
0 commit comments