P
Prisma•4w ago
tyler4949

ConnectorError after moving to Prisma Postgres

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 })
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.
7 Replies
Prisma AI Help
Prisma AI Help•4w ago
You selected the carefully hand-crafted route. A dev artisan will respond soon. Meanwhile, the #ask-ai channel awaits if you're curious!
Nurul
Nurul•4w ago
Hey @tyler4949 👋 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?
tyler4949
tyler4949OP•4w ago
Hi @Nurul! 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!
Nurul
Nurul•4w ago
Can you please update to latest prisma version (6.3.0) and check if you still get the same issue? I see you are on version 5.20.0. This bug was fixed in version 6.0.0: https://github.com/prisma/prisma/issues/25196
GitHub
Prisma join tables unable to be replicated by default · Issue #2519...
Bug description (Creating an issue from my comment on this closed issue.) Due to Prisma relation tables not having a primary key and due to the default replica identity behaviour these tables are n...
tyler4949
tyler4949OP•4w ago
@Nurul 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
Nurul
Nurul•4w ago
Can you do a migration as mentioned here and check if you still get the error after the migration? https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-6#schema-change-for-implicit-m-n-relations-on-postgresql
Upgrade to Prisma ORM 6 | Prisma Documentation
Guides on how to upgrade to Prisma ORM 6
tyler4949
tyler4949OP•3w ago
Ah I didnt see this as part of the setup docs, thank you. I will try that @Nurul (Prisma) looks like that did the trick, thank you so much!

Did you find this page helpful?