prisma-dbml-generator
prisma-dbml-generator copied to clipboard
Should @id annotated columns be marked as not null?
I noticed that id columns are displayed as if it's nullable when deployed to dbdocs.
For example, this prisma schema produces such dbml modeling which lucks not null annotation for user_id column.
Input: schema.prisma
model User {
user_id Int @id
name String
}
Output: schema.dbml
Table User {
user_id Int [pk]
name String [not null]
}
I thought it's bit confusing, but is that somehow a designed behavior?
https://github.com/notiz-dev/prisma-dbml-generator/blob/955d62a3c34f2d5028902af3acf349cc1e91c60a/src/generator/table.ts#L114-L116