Demo: visualize Prisma models for review
Prisma models contain fields, relations, indexes, and enum choices. A diagram helps teams inspect domain shape before migrations are generated.
- Check @relation fields and foreign keys together.
- Review @@unique and @@index near the model they protect.
- Use the diagram to explain model relationships to frontend and product teams.
model User {
id Int @id @default(autoincrement())
email String @unique
posts Post[]
}
model Post {
id Int @id
author User @relation(fields: [authorId], references: [id])
authorId Int
}