Awey
02/06/2021, 10:26 PMmodel Comment {
id Int @id @default(autoincrement())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
text String
author User? @relation(fields: [authorId], references: [id])
authorId Int? @map("author_id")
post Post? @relation(fields: [postId], references: [id])
postId Int? @map("post_id")
replies Comment[] @relation("CommentToComment")
parent Comment? @relation("CommentToComment", fields: [parentId], references: [id])
parentId Int? @map("parent_id")
@@map("comments")
}
Awey
02/06/2021, 10:26 PMhttps://i.postimg.cc/V6st1vkv/Screen-Shot-2021-01-19-at-1-43-55-AM.png▾
nikolasburk
Awey
02/09/2021, 5:19 AMAwey
02/13/2021, 12:51 AM...
parentId: {
connect: {
id: args.parentId ? args.parentId : null
}
}
...