Skip to content

Commit 6314f98

Browse files
authored
Merge pull request #255 from rudcode/main
Fix postgres auto increment primary key
2 parents 257209c + c78245c commit 6314f98

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/utils/exportSQL/postgres.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export function toPostgres(diagram) {
3232
`${exportFieldComment(field.comment)}\t"${
3333
field.name
3434
}" ${field.type}${field.isArray ? " ARRAY" : ""}${field.notNull ? " NOT NULL" : ""}${field.unique ? " UNIQUE" : ""}${
35+
field.increment ? " GENERATED BY DEFAULT AS IDENTITY" : ""
36+
}${
3537
field.default.trim() !== ""
3638
? ` DEFAULT ${parseDefault(field, diagram.database)}`
3739
: ""

0 commit comments

Comments
 (0)