@ignore on required fields disables create and update operations on model #13467
Labels
bug/1-unconfirmed
Bug should have enough information for reproduction, but confirmation has not happened yet.
kind/bug
A reported bug.
team/client
Issue for team Client.
Bug description
According to docs:
When you set
@ignore
on required fields the client generation does not create the functions for create, update, upsert, etc., for the model. I realize this might be intended behavior. If so the docs could probably use some clarifications on @ignore and I would love some pointers on how to get around the problem.For context, I'm trying to get prisma working with temporal tables, which requires the table to have two non-nullable datetime fields which are set by the database. If I set the fields to be nullable with a
?
the client generation works as I expect but then prisma migrate will try to change the fields to be nullable. More hereHow to reproduce
npx prisma generate
and run:Gives error:
TypeError: prisma.testModel.create is not a function
Expected behavior
Be able to use functions like create, createMany, update, etc. on the model
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: