mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-07-18 10:11:24 +00:00
Use unsigned keyword only if type is signed (#528)
This commit is contained in:
@@ -27,9 +27,11 @@ 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}\` ${parseType(field)}${field.unsigned ? " UNSIGNED" : ""}${
|
`\t\`${field.name}\` ${parseType(field)}${
|
||||||
field.notNull ? " NOT NULL" : ""
|
dbToTypes[DB.MYSQL][field.type]?.signed && 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 !== ""
|
||||||
|
Reference in New Issue
Block a user