Nullable field cannot be inserted or updated
Hi! I've already broken my head, I've asked several ai chats why this might be an error, but they don't know why the error occurs
The problem is that I can't create/update the channels record's userId fields when the userId isn't set to .notNull()
When I bet .notNull() everything works for me, but I need the user Id to be an optional field
Thank you in advance for any hints :silly:
5 Replies
user.schema.ts
I found a closed issue that seems to relate directly to my problem
https://github.com/drizzle-team/drizzle-orm/issues/2654
GitHub
[BUG]: TypeScript error on optional fields during update (and inser...
What version of drizzle-orm are you using? 0.32.0 What version of drizzle-kit are you using? 0.23.0 Describe the Bug I've encountered a TypeScript error when trying to update an optional field ...
my tsconfig.json
who solved this problem?
You added
strict: true?
Did you try also restarting you're TS language server?Yes
the above is my config. I did everything that was offered in that issue on github
If you don't have such a problem, please upload your package versions