Export with size bug fixed
This commit is contained in:
parent
95366776e8
commit
7db4cc76a5
@ -2,6 +2,8 @@ import { dbToTypes } from "../../data/datatypes";
|
|||||||
import { parseDefault } from "./shared";
|
import { parseDefault } from "./shared";
|
||||||
|
|
||||||
export function toMySQL(diagram) {
|
export function toMySQL(diagram) {
|
||||||
|
console.log(diagram);
|
||||||
|
// console.log(mysqlTypes[field.type.toString()]);
|
||||||
return `${diagram.tables
|
return `${diagram.tables
|
||||||
.map(
|
.map(
|
||||||
(table) =>
|
(table) =>
|
||||||
@ -12,7 +14,9 @@ export function toMySQL(diagram) {
|
|||||||
(field) =>
|
(field) =>
|
||||||
`${field.comment === "" ? "" : `\t-- ${field.comment}\n`}\t\`${
|
`${field.comment === "" ? "" : `\t-- ${field.comment}\n`}\t\`${
|
||||||
field.name
|
field.name
|
||||||
}\` ${field.type}${field.notNull ? " NOT NULL" : ""}${
|
}\` ${field.type}${(field.size !== undefined && field.size !== "")? "(" + field.size + ")" : ""}${
|
||||||
|
field.notNull ? " NOT NULL" : ""
|
||||||
|
}${
|
||||||
field.increment ? " AUTO_INCREMENT" : ""
|
field.increment ? " AUTO_INCREMENT" : ""
|
||||||
}${field.unique ? " UNIQUE" : ""}${
|
}${field.unique ? " UNIQUE" : ""}${
|
||||||
field.default !== ""
|
field.default !== ""
|
||||||
|
Loading…
Reference in New Issue
Block a user