Closed jannis6023 closed 9 months ago
Here's an example prisma scheme with the bug-producing relation - is fixed in this pull request!
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator clent {
provider = "prisma-client-js"
binaryTargets = ["native", "rhel-openssl-1.0.x", "darwin"]
}
generator prismaClassGenerator {
provider = "node -r ts-node/register/transpile-only src/index.ts"
output = "../src/_gen/prisma-class"
dryRun = "false"
separateRelationFields = "true"
}
model Person {
id Int @id @default(autoincrement())
Company Company[]
}
model Company {
id Int @id
childCompany Company? @relation("parent_child", fields: [childCompanyId], references: [id])
childCompanyId Int? @unique
parentComany Company? @relation("parent_child")
owner Person @relation(fields: [personId], references: [id])
personId Int
}
@kimjbstar Thanks for your fast merge! Could you also run a npm publish for a new version number, so we can import it in our projects? Thanks!
@kimjbstar I'm also eagerly awaiting the npm publish. Can't wait to use the new updates in our projects!
Hi, we are waiting as well. Therefor, we published the fork: @jannis6023/prisma-class-generatorBest Regards,JannisAm 19.04.2024 um 03:10 schrieb Ko Kawanabe @.***>: @kimjbstar I'm also eagerly awaiting the npm publish. Can't wait to use the new updates in our projects!
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
checking for wether using separateRelationFields => then add import in relation file, if not then don't generate relation import.