Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imports not generated #38

Open
MiralemMemic opened this issue Jul 17, 2023 · 0 comments · Fixed by mmemic/prisma-class-generator#1 · May be fixed by #44
Open

Imports not generated #38

MiralemMemic opened this issue Jul 17, 2023 · 0 comments · Fixed by mmemic/prisma-class-generator#1 · May be fixed by #44

Comments

@MiralemMemic
Copy link

First things first, this is an awesome and very useful package 🙌

I have experienced problems with models that have relations to themselves while using the separateRelationFields flag. First, the school_relation class is generated, and afterward the actual school class. This results in school_relation.ts missing imports from school.ts which I need to add manually later. Not a huge deal but it gets tedious on a large-scale project. Maybe this can be solved by reverting the order so that we first generate school.ts and then school_relation.ts?

Expected Behavior

Imports are also generated.

Actual Behavior

Imports are not generated.

Steps to Reproduce the Problem

define a model in schema.prisma

model School {
  id      String
  School  School  @relation()
}

define a generator

generator prismaClassGenerator {
  ...
  separateRelationFields = "true"
  ...
}

run prisma generate

Specifications

  • Version: 0.2.6
  • Prisma Version: 4.15.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant