mirror of
https://github.com/drawdb-io/drawdb.git
synced 2026-02-11 02:00:37 +08:00
add enum type
This commit is contained in:
@@ -59,7 +59,11 @@ function jsonToSQL(obj) {
|
||||
`${field.comment === "" ? "" : `\t-- ${field.comment}\n`}\t\`${
|
||||
field.name
|
||||
}\` ${field.type}${
|
||||
field.length !== "n/a" ? `(${field.length})` : ""
|
||||
field.length !== "n/a"
|
||||
? `(${field.length})`
|
||||
: field.enumValues
|
||||
? `(${field.enumValues.map((v) => `"${v}"`).join(", ")})`
|
||||
: ""
|
||||
}${field.notNull ? " NOT NULL" : ""}${
|
||||
field.increment ? " AUTO_INCREMENT" : ""
|
||||
}${field.unique ? " UNIQUE" : ""}${
|
||||
|
||||
Reference in New Issue
Block a user