Bug: D1 One-to-Many Relation INSERTs fail with The required connected records were not found.
when using indices
#23902
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
kind/bug
A reported bug.
team/client
Issue for team Client.
topic: d1
Issues related to Cloudflare D1
topic: driverAdapters
topic: @prisma/adapter-d1
Milestone
Bug description
When creating rows with a one-to-many relation and using manually added
@@index
s, the query fails with:I believe this happens due to D1 returning the number of rows written, including writes to index tables... not actual written data rows.
How to reproduce
See the reproduction here: https://github.com/hrueger/prisma-23902. Basically, you need
Expected behavior
It should connect the record.
I think I found two possible ways:
rows_written
orPrisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: