I have a datamodel which resembles that of below. ...
# orm-help
c
I have a datamodel which resembles that of below. I am unable to delete `User`s when they have an
EmailVerificaton
tied to them. I think this has to do with the relationship type that is set. Do you know how I can revise the model so that deletes on
User
automatically delete associated `EmailVerification`s
Copy code
type User {
    id: ID! @id
    name: String!
    email: String! @unique
    emailVerification: [EmailVerification] @relation(name: "UserEmailVerifications")
}

type EmailVerification{
    id: ID! @id
    verificationCode: String! @unique
    user: User! @relation(name: "UserEmailVerifications")
}
I figured it out. If anyone was curious I updated my user model to tell it how to handle deletes with:
Copy code
type User {
    id: ID! @id
    name: String!
    email: String! @unique
    emailVerification: [EmailVerification] @relation(name: "UserEmailVerifications", onDelete: CASCADE)
}