Merge branch 'main' into main
This commit is contained in:
commit
d208e37a41
@ -11,7 +11,7 @@ export function toMariaDB(diagram) {
|
|||||||
(field) =>
|
(field) =>
|
||||||
`\t\`${
|
`\t\`${
|
||||||
field.name
|
field.name
|
||||||
}\` ${field.type}${field.unsigned ? " UNSIGNED" : ""}${field.notNull ? " NOT NULL" : ""}${
|
}\` ${field.type}${field.values ? "(" + field.values.map((value) => "'" + value + "'").join(", ") + ")" : ""}${field.unsigned ? " UNSIGNED" : ""}${field.notNull ? " NOT NULL" : ""}${
|
||||||
field.increment ? " AUTO_INCREMENT" : ""
|
field.increment ? " AUTO_INCREMENT" : ""
|
||||||
}${field.unique ? " UNIQUE" : ""}${
|
}${field.unique ? " UNIQUE" : ""}${
|
||||||
field.default !== ""
|
field.default !== ""
|
||||||
|
@ -9,7 +9,7 @@ export function toMySQL(diagram) {
|
|||||||
`CREATE TABLE \`${table.name}\` (\n${table.fields
|
`CREATE TABLE \`${table.name}\` (\n${table.fields
|
||||||
.map(
|
.map(
|
||||||
(field) =>
|
(field) =>
|
||||||
`\t\`${field.name}\` ${field.type}${field.unsigned ? " UNSIGNED" : ""}${field.size !== undefined && field.size !== "" ? "(" + field.size + ")" : ""}${
|
`\t\`${field.name}\` ${field.type}${field.values ? "(" + field.values.map((value) => "'" + value + "'").join(", ") + ")" : ""}${field.unsigned ? " UNSIGNED" : ""}${field.size !== undefined && field.size !== "" ? "(" + field.size + ")" : ""}${
|
||||||
field.notNull ? " NOT NULL" : ""
|
field.notNull ? " NOT NULL" : ""
|
||||||
}${
|
}${
|
||||||
field.increment ? " AUTO_INCREMENT" : ""
|
field.increment ? " AUTO_INCREMENT" : ""
|
||||||
|
Loading…
Reference in New Issue
Block a user