Skip to content

Instantly share code, notes, and snippets.

@kt3k
Created October 13, 2022 23:51
Show Gist options
  • Save kt3k/7b2885f1986d8ec79b6adc1110b0876c to your computer and use it in GitHub Desktop.
Save kt3k/7b2885f1986d8ec79b6adc1110b0876c to your computer and use it in GitHub Desktop.
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
posts Post[]
}
model Post {
id Int @id @default(autoincrement())
title String
content String?
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId Int
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment