You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm trying to understand why some fields are removed during the generation of mermaid diagram. For example I have such a schema:
model User {
id String @id
email String
favoriteProducts FavoriteProducts[]
}
model Product {
id String @id
title String
inFavorites FavoriteProducts[]
}
model FavoriteProducts {
userId String
user User @relation(fields: [userId], references: [id])
productId String
product Product @relation(fields: [productId], references: [id])
@@id([userId, productId])
}
The generated mermaid diagram doesn't contain userId and productId. Is it possible to somehow show them?
erDiagram
User {
String id PK
String email
}
Product {
String id PK
String title
}
FavoriteProducts {
}
FavoriteProducts o{--|| User : "user"
FavoriteProducts o{--|| Product : "product"
I checked source code and they are filtered out in file src/generate.ts:178 - 182 Why it was done in such a way?
Thanks for your answer.
The text was updated successfully, but these errors were encountered:
I don't think there is anything wrong with either approach. I've seen both. This is built off of an existing algorithm that put emphasis on the connection lines and representing those relationships as opposed to having every foreign key in the models.
If you'd like to add an option that would add those in feel free to send me a PR. I'm happy to add it in as long as it isn't going to change everyone's current ERD's
Hello, I'm trying to understand why some fields are removed during the generation of mermaid diagram. For example I have such a schema:
The generated mermaid diagram doesn't contain userId and productId. Is it possible to somehow show them?
I checked source code and they are filtered out in file src/generate.ts:178 - 182 Why it was done in such a way?
Thanks for your answer.
The text was updated successfully, but these errors were encountered: