@foyarash
// prisma/schema.prisma
enum Role {
USER
ADMIN
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
password String @default("")
posts Post[] @relation("author") // One-to-many relation
profile Profile? @relation("profile") // One-to-one relation
birthDate DateTime?
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
role Role @default(USER)
}
For the User model, do you have a suggestion on how to create two different list views of the User model ?
I'd like it to be two different pages in my webapp, example:
/User
/UserAdmin
The User model configuration for both routes is different in each case
@foyarash
For the
Usermodel, do you have a suggestion on how to create two different list views of theUsermodel ?I'd like it to be two different pages in my webapp, example:
/User/UserAdminThe
Usermodel configuration for both routes is different in each case