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
|
||||
.map(
|
||||
(field) =>
|
||||
`\t\`${field.name}\` ${parseType(field)}${field.unsigned ? " UNSIGNED" : ""}${
|
||||
field.notNull ? " NOT NULL" : ""
|
||||
}${
|
||||
`\t\`${field.name}\` ${parseType(field)}${
|
||||
dbToTypes[DB.MYSQL][field.type]?.signed && field.unsigned
|
||||
? " UNSIGNED"
|
||||
: ""
|
||||
}${field.notNull ? " NOT NULL" : ""}${
|
||||
field.increment ? " AUTO_INCREMENT" : ""
|
||||
}${field.unique ? " UNIQUE" : ""}${
|
||||
field.default !== ""
|
||||
|
Reference in New Issue
Block a user