Here is my Prisma schema:
model User {
id String @id @default(uuid())
email String @unique
mailing_address String
password String
verification_token String?
verification_token_expires DateTime?
reset_password_token String?
reset_password_expires DateTime?
name String?
roles Role[]
last_auth_change DateTime @default(now())
}
enum Role {
SUPER_ADMIN
ADMIN
USER
EMAIL_VERIFIED
UNVERIFIED
}
I need to notify all super admins when a user verifies their email.
The SQL query for this task is :
'SELECT "id", "mailing_address", "roles" FROM "User" WHERE "roles" @> ARRAY[\'SUPER_ADMIN\']::"Role"[] ;'
However, I am having trouble figuring out how to achieve this using Prisma. When constructing the where clause for roles in Prisma, the only available option is equal
.