Unique Constraints Failed
When adding a record with prisma studio, I am getting the error "Unique constraint failed on the constraint: `Server_secret_key`". I don't have any field named "Server_secret_key" so I don't know why its saying that.
6 Replies
Can you try generating your Prisma Client again and checking?
npx prisma generate
same thing happens. the only 2 values that I have on that model that are marked as unique are
token
and name
.Can you shate your model in which you are getting this error?
I'll try to reproduce.
the model looks like this. it is using mongodb as the provider.
I still haven't been able to figure out this issue
I legit removed all
@unique
and it still is saying unique constraints failedWhat happens if you do
npx prisma db pull
?
Do you get a field named secret_key
in your Server model?im using mongo so it doesnt seem to support it. but I did it with --force and it shows a field named
secret
with the type Json?
tho I don't see that field when I view the database through mongo cloud
well no currently documents for server currently exist so not sure where it got that from