Clément Guibout
08/13/2022, 2:28 PMRaphael Etim
08/15/2022, 9:37 AMClément Guibout
08/20/2022, 2:25 AMClément Guibout
08/20/2022, 2:29 AMmodel Event {
evt_id String @id @default(uuid())
evt_title String
}
model Organization {
org_id String @id @default(uuid())
org_name String
}
And here is the request that fails
const newEvent = await prisma.event.create({
data: {
evt_title: parsedCreateEventSchema.evt_title
},
})
as you can see, I am just requesting to create an object, so the id should be calculated without any issue.
I have a similar request for the Organizations model that just works fine, this is strange... I have seen other people having the same issue online, but no fix sadly 😞
@Raphael EtimClément Guibout
08/20/2022, 2:31 AM61 try {
→ 62 const newEvent = await prisma.event.create(
Unique constraint failed on the fields: (`evt_id`)
Raphael Etim
08/20/2022, 2:55 AMRaphael Etim
08/20/2022, 3:14 AMRaphael Etim
08/20/2022, 3:15 AMClément Guibout
08/20/2022, 1:49 PMClément Guibout
08/20/2022, 1:52 PMevt_organizer Organization @relation(fields: [evt_id], references: [org_id])
and from the organizer its
org_events Event[]
Clément Guibout
08/20/2022, 1:53 PMClément Guibout
08/20/2022, 1:53 PMClément Guibout
08/20/2022, 1:54 PMRaphael Etim
08/30/2022, 7:42 AMClément Guibout
08/30/2022, 11:48 AMClément Guibout
08/30/2022, 11:51 AMRaphael Etim
08/30/2022, 11:51 AMClément Guibout
09/08/2022, 11:19 PMRaphael Etim
09/09/2022, 7:06 AM