Search
Setup for Free
TTC
Theo's Typesafe Cult
Unique constraint failed on the (not available)
Original message was deleted
Theo's Typesafe Cult
Join
26,223
Members
View on Discord
Similar Threads
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
A
averagedev999
•
11/6/23, 10:56 AM
are you sure about the unique constraint on chatRoomId in the event model
?
P
perako
•
11/6/23, 10:59 AM
just tested it again
, now its not allowing me to upload event even the first one
, its saying
Invalid
prisma.event.create()
prisma.event.create()
invocation
:
Unique constraint failed on the
(not available
)
,
tryna figure out whats wrong
A
averagedev999
are you sure about the unique constraint on chatRoomId in the event model?
P
perako
•
11/6/23, 11:07 AM
it seems like I did the explicit many to many relation wrong
,
I tried to make it implicit and now it works again
A
averagedev999
•
11/6/23, 11:08 AM
awesome
A
averagedev999
awesome
P
perako
•
11/6/23, 11:08 AM
But tryna make it to explicit tho for role staff
,
can you review my UserInChatRoom
?
A
averagedev999
•
11/6/23, 11:09 AM
i don
’t get the question
P
perako
•
11/6/23, 11:10 AM
theres a photo of UserInChatRoom in my question
,
I think I did it wrong
,
Im tryna make it a explicit many to many
A
averagedev999
•
11/6/23, 11:12 AM
try setting up a composite unique index on userId and chatRoomId instead of just userId
A
averagedev999
•
11/6/23, 11:12 AM
cuz one user can be in many chat rooms
A
averagedev999
•
11/6/23, 11:13 AM
btw i g2g now and will answer other questions later in the evening
B
Balduin
•
11/6/23, 11:42 AM
that
toast
toast
are you using
? is it custom or a libary
?
B
Balduin
that `toast` are you using? is it custom or a libary?
P
perako
•
11/6/23, 6:29 PM
react
-hot
-toast library
prisma.event.create()
prisma.event.create()
toast
toast
Similar Threads
Unique constraint failed on the (not available)
TTC
Theo's Typesafe Cult / questions
3y ago
Unique key constraint error
TTC
Theo's Typesafe Cult / questions
2y ago
Unique Constraint in Drizzle
TTC
Theo's Typesafe Cult / questions
3y ago
Postgres not available on Vercel
TTC
Theo's Typesafe Cult / questions
13mo ago