Error when updating Record

I just set up prisma postgres and when I try to update a relationship I get the following error. PostgresError { code: "55000", message: "cannot delete from table \"_LocationToLocationType\" because it does not have a replica identity and publishes deletes", severity: "ERROR", detail: None, column: None, hint: Some("To enable deleting from the table, set REPLICA IDENTITY using ALTER TABLE.") how to fix this using prisms ORM?
13 Replies
RaphaelEtim
RaphaelEtim2mo ago
Hi @davidpink This is a known issue and we are working to provide a fix. I'll provide updates once the fix is rolled out.
davidpink
davidpinkOP2mo ago
great, thank you. Keep me posted
RaphaelEtim
RaphaelEtim2mo ago
Hi @davidpink Can you please share the schema file and the migration file as well?
davidpink
davidpinkOP2mo ago
model LocationType { id String @id @default(cuid()) name String @db.VarChar(255) slug String @unique i18nextKey String icon LocationTypeShort createdAt DateTime @default(now()) locations Location[] } model Location { id String @id @default(cuid()) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt slug String @unique name String @db.VarChar(255) ownerId String owner User @relation(fields: [ownerId], references: [id], onDelete: Restrict) isVerified Boolean @default(false) verifiedAt DateTime? verifiedPlaceId String? @db.VarChar(255) onboardingCompleted Boolean @default(false) locationTypes LocationType[] @@index([slug]) } there’s no migration file. I tried to update the location types with locationTypes: locationTypes ? { set: [], connect: locationTypes?.map((locationType) => ({ id: locationType, })), } : undefined,
RaphaelEtim
RaphaelEtim2mo ago
What does the model for LocationTypeShort look like?
davidpink
davidpinkOP2mo ago
enum LocationTypeShort { studio shop retreat school }
RaphaelEtim
RaphaelEtim2mo ago
Thank you, I've shared it with the team for investigation.
davidpink
davidpinkOP2mo ago
any updates on this one yet?
RaphaelEtim
RaphaelEtim2mo ago
We have identified the root cause and have prioritize this issue. I'll provide an update once the fix is rolled out by the engineering team.
RaphaelEtim
RaphaelEtim4w ago
Hi @davidpink With the release of Prisma 6 yesterday, this issue was fixed. Can you please try and see that this si resolved for you. You can learn more about the fix here
GitHub
Release 6.0.0 · prisma/prisma
We’re excited to share the Prisma ORM v6 release today 🎉 As this is a major release, it includes a few breaking changes that may affect your application. Before upgrading, we recommend that you che...
davidpink
davidpinkOP3w ago
awesome thank you! it’s working as expected now. thank you!
RaphaelEtim
RaphaelEtim3w ago
You’re welcome 🎉
Want results from more Discord servers?
Add your server