You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @joelrb, what you're reporting is working as intended. ENUM declarations are not global: they live in a database schema. Hence, indicating which schema they belong to is required when working with multiple database schemas, like in your case.
I hope this helps! I'm closing this as "not an issue", but if you have further comments, please add them below here. Thanks :)
Bug description
Why would an enum needs a schema? Error without it.
enum UserRole {
SUPERADMIN
ADMIN
USER
@@Schema("sc_users")
}
model User {
id String @id @default(cuid())
role UserRole
@@Schema("sc_users")
}
How to reproduce
Add models in prisma.schema file.
Expected behavior
No error for enums.
Prisma information
// Add your schema.prisma
// Add your code using Prisma Client
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: