Skip to content
TypeScript
310 B
Raw Blame
model User {
  id Int @id @default(autoincrement())
  email String @unique
  name String?
  posts Post[]

  @@map("user")
}

model Post {
  id Int @id @default(autoincrement())
  title String
  authorId Int
  author User @relation(fields: [authorId], references: [id])

  @@index([authorId])
  @@map("post")
}