#ConnectorError after moving to Prisma Postgres

9 messages · Page 1 of 1 (latest)

fresh hare
#

I am in the process of migrating from a Neon postgres db to a Prisma Postgres db. I followed the migration docs to transfer my data and table structure: https://www.prisma.io/docs/getting-started/prisma-postgres/import-from-existing-database-postgresql

After doing this, I am able to load all data, but any delete or update is failing with this error:

Error occurred during query execution:
ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(PostgresError { code: "55000", message: "cannot delete from table \"_RecipeToRecipeCategory\" 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.") }), transient: false })

Here is the schema I am using: https://github.com/tylerpashigian/t3-recipe-book/blob/main/prisma/schema.prisma

Does anyone know why I'm getting this error and how I can fix it? Everything I am seeing points to my schema not being set up propely (likely a table missing an @id?), but I'm curious how this worked fine on my previous db.

tepid quailBOT
#

You selected the carefully hand-crafted route. A dev artisan will respond soon. Meanwhile, the #ask-ai channel awaits if you're curious!

harsh lantern
#

Hey @fresh hare 👋

Is this delete and update failing only for a specific table or for all tables?
Example: If you update a user model do you still get this error?

fresh hare
#

Hi @harsh lantern! Thank you for the response. It looks like I am able to delete a User just fine. When I try to delete the recipe is the issue though. I also get the recipe delete error in Prisma Studio. Let me know if you need any other info!

harsh lantern
fresh hare
#

@harsh lantern I did update to 6.3.0 as part of the Prisma Postgres setup steps. I ran the following command: npm install prisma @prisma/client@latest @prisma/extension-accelerate. Sorry, these changes are on my local, I havent pushed these up yet. I just wanted to share my prisma schema with you as a reference because that hasnt changed

#

I am still getting the same issue with that though

harsh lantern
fresh hare
#

Ah I didnt see this as part of the setup docs, thank you. I will try that