Polymorphism: Invalid logical schema generated
drichardcarl opened this issue · comments
Description and expected behavior
Whenever I try to use field mapping (using @map()
) on my model that holds the relation to my polymorphic model, I get errors like error: Field "delegate_aux_User_profileId_CorporateProfile" is already defined on model "User"
. But when I don't, I get no errors. I'm expecting that either way, it should run just fine.
(comparison: left w/o @Map(), right w/ @Map())
Environment (please complete the following information):
- ZenStack version: 2.2.4
- Prisma version: 5.13.0
- Database type: MySQL 8
Additional context
As shown on the screenshots, different fields were marked with the same @map("profile_id")
which is the reason why the generated logical schema is invalid.