Skip to content

Commit 25542b5

Browse files
authored
Add type size when exporting postgres
1 parent 5c2262e commit 25542b5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/utils/exportSQL/postgres.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ export function toPostgres(diagram) {
3131
(field) =>
3232
`${exportFieldComment(field.comment)}\t"${
3333
field.name
34-
}" ${field.type}${field.isArray ? " ARRAY" : ""}${field.notNull ? " NOT NULL" : ""}${field.unique ? " UNIQUE" : ""}${
34+
}" ${field.type}${
35+
field.size !== undefined && field.size !== "" ? "(" + field.size + ")" : ""
36+
}${field.isArray ? " ARRAY" : ""}${field.notNull ? " NOT NULL" : ""}${field.unique ? " UNIQUE" : ""}${
3537
field.increment ? " GENERATED BY DEFAULT AS IDENTITY" : ""
3638
}${
3739
field.default.trim() !== ""

0 commit comments

Comments
 (0)