Replies: 8 comments 5 replies
-
|
When i tried to set : ["CUSTOMER", "BARBER"] i get this error ==> of type List on prisma.createOneUser is not a Role. Possible values: Role.ADMIN, Role.MANAGER, Role.SUPERADMIN, Role.BARBER, Role.CUSTOMER |
Beta Was this translation helpful? Give feedback.
-
|
Did you generate a new Prisma client after modifying the schema file? |
Beta Was this translation helpful? Give feedback.
-
I didn't do that |
Beta Was this translation helpful? Give feedback.
-
Let me check after generate à new schema file |
Beta Was this translation helpful? Give feedback.
-
|
The schema you pasted is quite big and it's a bit hard to go through all of it, but if you want to insert multiple enum values into a field, the field needs to be an array field, e.g., model MyModel {
id Int @id
roles Role[]
}... instead of just |
Beta Was this translation helpful? Give feedback.
-
|
dear, i'm honored to know that you care about my bug, uh i did not find
yet a solution, and the proposed solution did not work. if you have others
solutions, i will be glad to know it.
Le mar. 13 déc. 2022 à 13:54, Vladi Stevanovic ***@***.***> a
écrit :
… 👋 Hi @guyzoum77 <https://github.com/guyzoum77> , did you perhaps have a
chance to check Evie's recommendation? Let us know if you still have any
questions!
Or, if you've found a solution, we'd love to know how you solved this
problem. Feel free to post it in this thread and "Mark as answer" if this
discussion is now solved!
—
Reply to this email directly, view it on GitHub
<#16484 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALQIIAHGT3A3YOLA5XN23ILWNB5X7ANCNFSM6AAAAAAS5HUSN4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
I resolved the issue. After that I executed the prisma command: npx prisma
generate, I pasted this code : * const { PrismaClient } =
require('../../../../prisma/node_modules/.prisma/client'); *
and it works well for me.
Le jeu. 22 déc. 2022 à 07:07, Harshit Pant ***@***.***> a
écrit :
… Can you please share the query that you are performing? That we can try to
reproduce this error ourselves.
—
Reply to this email directly, view it on GitHub
<#16484 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALQIIAA2Z32LF2U6P474L6DWOP43ZANCNFSM6AAAAAAS5HUSN4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Hi there, To keep our discussions organized and focused on the most relevant topics, we’re reviewing and tidying up our backlog. As part of this process, we’re closing discussions that have already been marked as answered but remain open. If this discussion still requires further input or clarification, feel free to reopen it or start a new one with updated details. Your contributions are invaluable to the community, and we’re here to help! For more details about our priorities and vision for the future of Prisma ORM, check out our latest blog post: https://www.prisma.io/blog/prisma-orm-manifesto. Thank you for your understanding and ongoing support of the Prisma community! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Originally posted by guyzoum77 November 26, 2022
Bug description
that's my enum:
enum Role {
ADMIN
MANAGER
SUPERADMIN
BARBER
CUSTOMER
}
and i want to store Value like this: ['CUSTOMER', 'BARBER']
and i have this error:
Argument role: Provided value
[
'CUSTOMER',
'BARBER'
]
of type List on prisma.createOneUser is not a Role. Possible values: Role.ADMIN, Role.MANAGER, Role.SUPERADMIN, Role.BARBER, Role.CUSTOMER
How to reproduce
Expected behavior
No response
Prisma information
generator client {
provider = "prisma-client-js"
previewFeatures = ["extendedWhereUnique", "selectRelationCount"]
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model User {
id String @id @unique @default(uuid())
username String @unique
email String @unique
avatar String?
firstname String
lastname String
hashedPassword String @db.VarChar(255)
telephone String
isActive Boolean @default(false)
passwordChangeDate DateTime?
confirmToken String? @db.VarChar(255)
forgetPasswordToken String? @db.VarChar(255)
forgetPasswordTokenExpired DateTime?
emailVerified Boolean @default(false)
userComputer String?
IpAddress String?
role Role
salt String?
address String
lastConnexion DateTime?
isDeleted Boolean? @default(false)
auth2Fa Boolean? @default(false)
createdAt DateTime @default(now())
updatedAt DateTime?
Appointment Appointment[]
DiscountCoupon DiscountCoupon[]
HairdresserAvailability HairdresserAvailability[]
HairdresserRating HairdresserRating[]
Orders Orders[]
Product Product[]
ProductPackage ProductPackage[]
ProductType ProductType[]
PurchaseOrder PurchaseOrder[]
ServiceTypes ServiceTypes[]
Services Services[]
TrackingOrder TrackingOrder[]
RefreshToken RefreshToken[]
Banned Banned?
}
model RefreshToken {
id String @id @unique @default(uuid())
hashedToken String
expiresToken DateTime
userId String
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
revoked Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedat
}
model Banned {
id String @id @unique @default(uuid())
username String
userAgent String
ipAddress String
createdAt DateTime @default(now())
updatedAt DateTime @updatedat
user User @relation(fields: [userId], references: [id])
userId String @unique
}
model HairdresserAvailability {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime? @updatedat
userId String?
availability Availability
user User? @relation(fields: [userId], references: [id])
Appointment Appointment[]
@@index([userId], map: "HairdresserAvailability_userId_fkey")
}
model HairdresserRating {
id Int @id @default(autoincrement())
note Int
createdAt DateTime @default(now())
customerId String?
userId String?
customer Customer? @relation(fields: [customerId], references: [id])
user User? @relation(fields: [userId], references: [id])
@@index([customerId], map: "HairdresserRating_customerId_fkey")
@@index([userId], map: "HairdresserRating_userId_fkey")
}
model Customer {
id String @id @default(uuid())
fullName String @db.VarChar(255)
sex Sex
email String?
phoneNumber String @db.Text
category Category
residence String @db.Text
createdAt DateTime @default(now())
updatedAt DateTime? @updatedat
Appointment Appointment[]
HairdresserRating HairdresserRating[]
Orders Orders[]
Product Product[]
}
model DiscountCoupon {
id String @id @default(uuid())
percent Int
expiresCoupon DateTime
usingTimeCoupon Int
createdAt DateTime @default(now())
updatedAt DateTime? @updatedat
userId String
productTypeId Int @unique
productType ProductType @relation(fields: [productTypeId], references: [id])
user User @relation(fields: [userId], references: [id])
ProductPackage ProductPackage?
@@index([userId], map: "DiscountCoupon_userId_fkey")
}
model ProductPackage {
id String @id @default(uuid())
packageName String
expiresPackage DateTime
createdAt DateTime @default(now())
updatedAt DateTime? @updatedat
discountCouponId String? @unique
userId String
productTypeId Int
discountCoupon DiscountCoupon? @relation(fields: [discountCouponId], references: [id])
productType ProductType @relation(fields: [productTypeId], references: [id])
user User @relation(fields: [userId], references: [id])
@@index([productTypeId], map: "ProductPackage_productTypeId_fkey")
@@index([userId], map: "ProductPackage_userId_fkey")
}
model Supplier {
id String @id @default(uuid())
supplierName String
company String
phoneNumber String @db.VarChar(255)
address String @db.Text
createdAt DateTime @default(now())
updatedAt DateTime? @updatedat
PurchaseOrder PurchaseOrder[]
}
model PurchaseOrder {
id String @id @default(uuid())
purchaseOrderReference String
productReference String
productQte Int
Tva Float
productItemPrice Int
productCost Int
purchaseOrderDate DateTime
createdAt DateTime @default(now())
updatedAt DateTime? @updatedat
supplierId String
userId String
supplier Supplier @relation(fields: [supplierId], references: [id])
user User @relation(fields: [userId], references: [id])
@@index([supplierId], map: "PurchaseOrder_supplierId_fkey")
@@index([userId], map: "PurchaseOrder_userId_fkey")
}
model Product {
id String @id @default(uuid())
productQte Int
createdAt DateTime @default(now())
updatedAt DateTime? @updatedat
productTypeId Int
userId String?
invoiceId String
paymentId String
customerId String
ordersId String?
productName String
customer Customer @relation(fields: [customerId], references: [id])
invoice Invoice @relation(fields: [invoiceId], references: [id])
orders Orders? @relation(fields: [ordersId], references: [id])
payment Payment @relation(fields: [paymentId], references: [id])
productType ProductType @relation(fields: [productTypeId], references: [id])
user User? @relation(fields: [userId], references: [id])
@@index([customerId], map: "Product_customerId_fkey")
@@index([invoiceId], map: "Product_invoiceId_fkey")
@@index([ordersId], map: "Product_ordersId_fkey")
@@index([paymentId], map: "Product_paymentId_fkey")
@@index([productTypeId], map: "Product_productTypeId_fkey")
@@index([userId], map: "Product_userId_fkey")
}
model ProductType {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime? @updatedat
userId String
productTypeCode String @db.VarChar(255)
productTypeCost Int
productTypeDescription String @db.LongText
productTypeName String @db.VarChar(255)
user User @relation(fields: [userId], references: [id])
DiscountCoupon DiscountCoupon?
Product Product[]
ProductPackage ProductPackage[]
@@index([userId], map: "ProductType_userId_fkey")
}
model Orders {
id String @id @default(uuid())
orderCode String @db.VarChar(255)
orderDesignation String @db.VarChar(255)
orderCost Int
orderStatus OrderStatus
createdAt DateTime @default(now())
updatedAt DateTime? @updatedat
addressId Int @unique
customerId String
invoiceId String?
paymentId String?
userId String?
address Address @relation(fields: [addressId], references: [id])
customer Customer @relation(fields: [customerId], references: [id])
invoice Invoice? @relation(fields: [invoiceId], references: [id])
payment Payment? @relation(fields: [paymentId], references: [id])
user User? @relation(fields: [userId], references: [id])
Product Product[]
TrackingOrder TrackingOrder?
@@index([customerId], map: "Orders_customerId_fkey")
@@index([invoiceId], map: "Orders_invoiceId_fkey")
@@index([paymentId], map: "Orders_paymentId_fkey")
@@index([userId], map: "Orders_userId_fkey")
}
model TrackingOrder {
id String @id @default(uuid())
trackingOrderCode String @db.VarChar(255)
trackingOrderStatus TrackingOrderStatus
createdAt DateTime @default(now())
updatedAt DateTime? @updatedat
orderId String @unique
userId String
order Orders @relation(fields: [orderId], references: [id])
user User @relation(fields: [userId], references: [id])
@@index([userId], map: "TrackingOrder_userId_fkey")
}
model Appointment {
id String @id @default(uuid())
appointmentCode String @db.VarChar(255)
appointmentEventName String @db.VarChar(255)
appointmentDescription String @db.VarChar(255)
appointmentStartDate DateTime
createdAt DateTime @default(now())
updatedAt DateTime? @updatedat
userId String?
customerId String
hairdresserAvailabilityId Int
appointmentEndDate DateTime
appointmentHourDate DateTime
customer Customer @relation(fields: [customerId], references: [id])
hairdresserAvailability HairdresserAvailability @relation(fields: [hairdresserAvailabilityId], references: [id])
user User? @relation(fields: [userId], references: [id])
@@index([customerId], map: "Appointment_customerId_fkey")
@@index([hairdresserAvailabilityId], map: "Appointment_hairdresserAvailabilityId_fkey")
@@index([userId], map: "Appointment_userId_fkey")
}
model Address {
id Int @id @default(autoincrement())
city String
address String
lat String
lng String
state String?
zipcode String?
createdAt DateTime @default(now())
updatedAt DateTime? @updatedat
Orders Orders?
}
model Services {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedat
userId String?
paymentId String
invoiceId String?
serviceTypeId Int?
invoice Invoice? @relation(fields: [invoiceId], references: [id])
payment Payment @relation(fields: [paymentId], references: [id])
serviceType ServiceTypes? @relation(fields: [serviceTypeId], references: [id])
user User? @relation(fields: [userId], references: [id])
@@index([invoiceId], map: "Services_invoiceId_fkey")
@@index([paymentId], map: "Services_paymentId_fkey")
@@index([serviceTypeId], map: "Services_serviceTypeId_fkey")
@@index([userId], map: "Services_userId_fkey")
}
model ServiceTypes {
id Int @id @default(autoincrement())
serviceName String?
serviceDescription String?
serviceCost String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedat
userId String
user User @relation(fields: [userId], references: [id])
Services Services[]
@@index([userId], map: "ServiceTypes_userId_fkey")
}
model Invoice {
id String @id @default(uuid())
invoiceReference String @db.VarChar(255)
invoiceDesignation String
invoiceStatus InvoiceStatus
tva Float
createdAt DateTime @default(now())
updatedAt DateTime @updatedat
Orders Orders[]
Product Product[]
Services Services[]
}
model Payment {
id String @id @default(uuid())
paymentReference String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedat
paymentTypeId Int
paymentProvider String?
paymentType PaymentType @relation(fields: [paymentTypeId], references: [id])
Orders Orders[]
Product Product[]
Services Services[]
@@index([paymentTypeId], map: "Payment_paymentTypeId_fkey")
}
model PaymentType {
id Int @id @default(autoincrement())
paymentTypeName PaymentTypeName
createdAt DateTime @default(now())
updatedAt DateTime @updatedat
Payment Payment[]
}
model LoginAttempts {
id Int @id @default(autoincrement())
ipAddress String?
userAgent String?
username String?
loginTimestamp DateTime? @default(now())
lockedTime DateTime?
}
enum Role {
ADMIN
MANAGER
SUPERADMIN
BARBER
CUSTOMER
}
enum InvoiceStatus {
PAID
PENDING
CANCEL
}
enum Sex {
MALE
FEMALE
}
enum Category {
ADULT
CHILD
YOUNG
}
enum PaymentTypeName {
MOBILE_PAYMENT
CASH
BANK_PAYMENT
}
enum OrderStatus {
PAID
PENDING
CANCEL
}
enum TrackingOrderStatus {
CHECKOUT
INPROGRESS
ARRIVAL
}
enum Availability {
AVAILABLE
OCCUPIED
}
Environment & setup
OS: Ubuntu
Database: MySql
Node.js Version: v16.17.0
Prisma Version
prisma : 4.3.1
Beta Was this translation helpful? Give feedback.
All reactions