You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey,
there is some niche error for complex models (many to many)
TypeError: Cannot read properties of undefined (reading 'type')
at getJoinIdType (/prisma-dbml-generator/dist/generator/many-to-many-tables.js:46:28)
at joinField (/prisma-dbml-generator/dist/generator/many-to-many-tables.js:39:47)
I did hack around and that's because of multiple named relations that are completely valid within Prisma
// This is your Prisma schema file,// learn more about it in the docs: https://pris.ly/d/prisma-schemadatasourcedb {provider="postgresql"url=env("DATABASE_URL")}generatorclient {provider="prisma-client-js"}generatordbml {provider="node./dist/generator.js"mapToDbSchema="false"}modelPerson {idString@id@default(uuid())// this is the problematic definitionSportClubMembersSportClubMembers[]@relation("member")ScienceClubMembersScienceClubMembers[]@relation("member")}modelSportClub {idString@id@default(uuid())membersSportClubMembers[]@@unique(id)}modelScienceClub {idString@id@default(uuid())membersScienceClubMembers[]@@unique(id)}//// Relations//// Members on SomethingsmodelSportClubMembers {SportClubSportClub@relation(fields: [sportClubId], references: id)sportClubIdStringPersonPerson@relation("member", fields: [personId], references: id)personIdString@@id([sportClubId, personId])}modelScienceClubMembers {ScienceClubScienceClub@relation(fields: [scienceClubId], references: id)scienceClubIdStringPersonPerson@relation("member", fields: [personId], references: id)personIdString@@id([scienceClubId, personId])}
The text was updated successfully, but these errors were encountered:
Hey,
there is some niche error for complex models (many to many)
I did hack around and that's because of multiple named relations that are completely valid within Prisma
The text was updated successfully, but these errors were encountered: