Closed bonsaideasea closed 1 month ago
userId
and user
are required, but the query that Studio runs returns data that is missing that and is null
instead - and hence throws an error (top right image). You need to fix your data to match your Prisma schema to be able to use Prisma Studio.
hey janpio, i really appreciate you responding. i think my data does match my prisma schema. do you see any discrepancies that i can not spot? (what's not crossed out is fake data from my postgres GUI tool)
i saw that "field user is required to return data" which is why i filled all the columns with dummy data.
user
should not really be a field with data in your table, but only a relation defined via userId
. You should have a User
model with for example fields like name
then.
You can run npx prisma db pull
to update your Prisma schema to match your current database structure - that might help you understand what is going on.
we do have a User and Channel model that my groupmates are taking care of. i totally see what you are saying now and it makes a lot of sense that i'll be retrieving data from their models for those two columns. thank you so much janpio.
i deleted "user" and "channel" off my postgres & this solved my issue!! bless you janpio.
Bug description
I'm not even sure how to word the issue I'm running into because I can't decrypt where my errors are coming from in Prisma Studio. I am not receiving a specific error code but it seems like I haven't initialized my prisma/client properly?? Has anyone ever seen this before and how did you resolve it?
How to reproduce
Expected behavior
I should be able to open up my "Message" model in prisma studio to update my database.
Prisma information
<-- schema.prisma -->
<-- client.ts -->
<-- route.ts -->
Environment & setup
Screenshot of page where the problem happened (if applicable)
No response
Prisma logs
No response