Merge pull request #258 from rudcode/main
Add type size when exporting postgres
This commit is contained in:
commit
df54f864da
@ -857,9 +857,8 @@ const postgresTypesBase = {
|
||||
return field.default.length <= field.size;
|
||||
},
|
||||
hasCheck: true,
|
||||
isSized: true,
|
||||
isSized: false,
|
||||
hasPrecision: false,
|
||||
defaultSize: 65535,
|
||||
hasQuotes: true,
|
||||
},
|
||||
BYTEA: {
|
||||
|
@ -31,7 +31,9 @@ export function toPostgres(diagram) {
|
||||
(field) =>
|
||||
`${exportFieldComment(field.comment)}\t"${
|
||||
field.name
|
||||
}" ${field.type}${field.isArray ? " ARRAY" : ""}${field.notNull ? " NOT NULL" : ""}${field.unique ? " UNIQUE" : ""}${
|
||||
}" ${field.type}${
|
||||
field.size !== undefined && field.size !== "" ? "(" + field.size + ")" : ""
|
||||
}${field.isArray ? " ARRAY" : ""}${field.notNull ? " NOT NULL" : ""}${field.unique ? " UNIQUE" : ""}${
|
||||
field.increment ? " GENERATED BY DEFAULT AS IDENTITY" : ""
|
||||
}${
|
||||
field.default.trim() !== ""
|
||||
|
Loading…
Reference in New Issue
Block a user