mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-12-19 01:00:21 +08:00
Merge pull request #255 from rudcode/main
Fix postgres auto increment primary key
This commit is contained in:
@@ -32,6 +32,8 @@ export function toPostgres(diagram) {
|
||||
`${exportFieldComment(field.comment)}\t"${
|
||||
field.name
|
||||
}" ${field.type}${field.isArray ? " ARRAY" : ""}${field.notNull ? " NOT NULL" : ""}${field.unique ? " UNIQUE" : ""}${
|
||||
field.increment ? " GENERATED BY DEFAULT AS IDENTITY" : ""
|
||||
}${
|
||||
field.default.trim() !== ""
|
||||
? ` DEFAULT ${parseDefault(field, diagram.database)}`
|
||||
: ""
|
||||
|
||||
Reference in New Issue
Block a user