Check the name/params of your unique constraint in...
# orm-help
j
Check the name/params of your unique constraint in the model - its probably just a snake/camelcase situation on the clause - see - https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#get-the-user-record-with-firstname-of-alice-and-lastname-of-smith-id as a reference
a
name of my constraints are
snake_case
everything in my model is
snake_case
. What should it be ?
j
doesn't really matter so long as they match up - I had a similar problem and ended up just looking in the generated client javascript code to see what it was, go look in your
.prisma/client/index.d.ts
file and scroll down to
search_historyWhereInput
and see what it is... I'm going to guess wher eyou have
unique_inventory
it should be
chemist_id_medicine_id_search_type
or something like that -- it'll show up in the
index.d.ts
file
my case was:
Copy code
export type UserWhereUniqueInput = {
    id?: string
    sendbird_id?: string
    email?: string
    auth0_user_id?: string
    external_id_external_source?: UserExternal_idExternal_sourceCompoundUniqueInput
  }
and that stemmed from a line in my User model like:
Copy code
model User {
  @@map("users")

// ....
  id String  @id @default(dbgenerated("gen_random_uuid()")) @db.Uuid

  external_source String?
  external_id     String?

//... 

@@unique([external_id, external_source])
}
a
Hey there, What does your schema look like?
j
@Austin I assume that question for the schema was directed at @Atharva Bhange?
👍 1
v
👋 hey @Atharva Bhange , I wanted to check if this issue is now resolved of it you still need any help? Let us know if you can share how your schema looks like.