How to update and upsert on particular columns on Prisma
On Prisma, I have a session model as follows
this is accepted with no type issues:
however, when updating or upserting as follows, I get yelled at for type issues:
the error I get is:
Type '{ user_id: bigint; }' is not assignable to type 'sessionsWhereUniqueInput'. Object literal may only specify known properties, and 'user_id' does not exist in type 'sessionsWhereUniqueInput'.ts(2322) index.d.ts(6213, 5): The expected type comes from property 'where' which is declared here on type '{ select?: sessionsSelect | null | undefined; data: (Without<sessionsUpdateInput, sessionsUncheckedUpdateInput> & sessionsUncheckedUpdateInput) | (Without<...> & sessionsUpdateInput); where: sessionsWhereUniqueInput; }'
how can I fix this?2 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
thank you! I went ahead and did that and it fixed the problem