Seba
Seba
PPrisma
Created by Seba on 1/10/2025 in #help-and-questions
PrismaClientValidationError
I thought that, maybe, there was a more clever way to do that (i.e. with OR clause). Thanks anyway and thank you again for the resource.
9 replies
PPrisma
Created by Seba on 1/10/2025 in #help-and-questions
PrismaClientValidationError
Thank you so much, it worked just fine, I wasn't aware of this syntax (name_surname_phone_number_email). Just one last thing: is there a way to connect the info with name_surname_phone_number_email or the userId?
9 replies
PPrisma
Created by Seba on 1/10/2025 in #help-and-questions
PrismaClientValidationError
This is my schema:
model Ticket {
id String @id @default(nanoid())
title String
description String
status TicketStatus @default(PENDING)
createdBy User? @relation("CreatedBy", fields: [userId], references: [id])
userId Int?
assignedTo User? @relation("AssignedTo", fields: [operatorId], references: [id])
operatorId Int?
infoId Int
info Information @relation(fields: [infoId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
closedAt DateTime?
}

model Information {
id Int @id @default(autoincrement())
name String
surname String
phone_number String?
email String?
userId Int? @unique
users User? @relation(fields: [userId], references: [id])
tickets Ticket[]

@@unique([name, surname, phone_number, email])
}
model Ticket {
id String @id @default(nanoid())
title String
description String
status TicketStatus @default(PENDING)
createdBy User? @relation("CreatedBy", fields: [userId], references: [id])
userId Int?
assignedTo User? @relation("AssignedTo", fields: [operatorId], references: [id])
operatorId Int?
infoId Int
info Information @relation(fields: [infoId], references: [id])
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
closedAt DateTime?
}

model Information {
id Int @id @default(autoincrement())
name String
surname String
phone_number String?
email String?
userId Int? @unique
users User? @relation(fields: [userId], references: [id])
tickets Ticket[]

@@unique([name, surname, phone_number, email])
}
9 replies