Repository navigation
Upsert in Many-to-many causing unique key constraint errors #14993
|
Hi guys, been trying to figure this out for the last couple of days but with no luck and figured I should ask for some help. I have multiple domains (100+) with information about the domain and which categories the domain is most likely to fall into aka Topics. Topic is what majestic thinks the domain is about. For examples the domain running.com has the topics of "Health 60%" and "Exercise 40%". Each domain can have multiple topics attached to the domain with a percentage. I decided to separate the topics from the percentage so there isnt any data duplication with Topics but this has been causing me lots of trouble. I had to make sure it was somewhat performant and it didnt create any race conditions so I am currently using a createMany to insert each domain into the Domains table and another createMany to insert each topic taken from each domain into MajesticTopicalTopic table. I created the schema with normalization in mind but am having trouble inserting data into the database with Prisma. I continue to get conflicting errors. Any tips on optimizing the schema and fixing the conflicting errors would be greatly appreciated. |
Replies: 2 comments 3 replies
|
Hey @DivMode 👋, I wasn't able to recreate this one with the given info. Would you mind providing some sample data so I can try to reproduce the error? |
|
Hi there, To keep our discussions organized and focused on the most relevant topics, we’re reviewing and tidying up our backlog. As part of this process, we’re closing discussions that have already been marked as answered but remain open. If this discussion still requires further input or clarification, feel free to reopen it or start a new one with updated details. Your contributions are invaluable to the community, and we’re here to help! For more details about our priorities and vision for the future of Prisma ORM, check out our latest blog post: https://www.prisma.io/blog/prisma-orm-manifesto. Thank you for your understanding and ongoing support of the Prisma community! |
Hey @DivMode 👋,
I wasn't able to recreate this one with the given info.
Would you mind providing some sample data so I can try to reproduce the error?