File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import { dbToTypes } from "../../data/datatypes";
2
2
import { parseDefault } from "./shared" ;
3
3
4
4
export function toMySQL ( diagram ) {
5
+ console . log ( diagram ) ;
6
+ // console.log(mysqlTypes[field.type.toString()]);
5
7
return `${ diagram . tables
6
8
. map (
7
9
( table ) =>
@@ -12,7 +14,9 @@ export function toMySQL(diagram) {
12
14
( field ) =>
13
15
`${ field . comment === "" ? "" : `\t-- ${ field . comment } \n` } \t\`${
14
16
field . name
15
- } \` ${ field . type } ${ field . notNull ? " NOT NULL" : "" } ${
17
+ } \` ${ field . type } ${ ( field . size !== undefined && field . size !== "" ) ? "(" + field . size + ")" : "" } ${
18
+ field . notNull ? " NOT NULL" : ""
19
+ } ${
16
20
field . increment ? " AUTO_INCREMENT" : ""
17
21
} ${ field . unique ? " UNIQUE" : "" } ${
18
22
field . default !== ""
You can’t perform that action at this time.
0 commit comments