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
[Prisma Client] Duplicate identifier with models "X" and "XClient" #2539
Comments
I can confirm this bug. Thanks for reporting! I also think we not add this case to the deny list as this naming pattern seems a bit common. |
It looks like it is already in the denylist. I will double check.
|
Thank you for the issue, the "denylist" is now applied to model names as well with tests. You probably want to rename your models to avoid a conflict here, one solution could be to use |
Does that mean that issue is fixed and I can keep current model names after eventual prisma release? |
@dodas So no it means that out internal list of reserved word just got updated and it will error properly now if you retry with the latest alpha. So you will need to change the names of your models. And if you already have these models in your database you could use |
That's unfortunate solution... |
I understand the problem here and I'm also in favor of finding a better solution 👍 |
I propose prefixing our implementation with internal. I don't know if this will be a breaking change or not: Generally we should prefix out implementation. What are your thoughts @Jolg42 ? |
I opened: prisma/prisma-client-js#707 |
Consider following datamodel:
Prisma seem to generate
class
for each model, withClient
appended to its name:..but it also generates
type
for each model, without appending anything to its name:This leads to typescript error, as
type CompanyClient
is clashing withclass CompanyClient
:Naming convention for "Client" classes should be altered, probably..
Prisma CLI / client version: 2.0.0-beta.5
The text was updated successfully, but these errors were encountered: