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?
8 Replies
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.
great, thank you. Keep me posted
Hi @davidpink
Can you please share the schema file and the migration file as well?
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,
What does the model for
LocationTypeShort
look like?enum LocationTypeShort {
studio
shop
retreat
school
}
Thank you, I've shared it with the team for investigation.