prisma1
prisma1 copied to clipboard
I think onDelete: CASCADE not working!
When I delete a blog, comments in a blog not deleted. I removed ! at User on blog and Blog on the comment because it's error. #1795
type User {
id: ID! @unique
comments: [Comment!]! @relation(name: "CommentAuthor", onDelete: CASCADE)
blog: Blog @relation(name: "BlogOwner", onDelete: CASCADE)
}
type Blog {
id: ID! @unique
comments: [Comment!]! @relation(name: "Comments", onDelete: CASCADE)
owner: User @relation(name: "BlogOwner", onDelete: SET_NULL)
}
type Comment {
id: ID! @unique
blog: Blog @relation(name: "Comments", onDelete: NO_ACTION)
author: User @relation(name: "CommentAuthor", onDelete: NO_ACTION)
}
https://github.com/graphcool/prisma/pull/1825 WIP now
Check #1262
This is now available on the unstable channel, please refer to the two mentioned links by @oxy88 and @emipc for more information 🙂