P
Prisma7d ago
Axxy

Primsa Studio Help

Hi! I am just looking for some help with regards to prisma studio. I current have this model
model Unit {
id Int @id @default(autoincrement())
name String @unique
items Item? // a unit can be for MULTIPLE items (1-M)
}


model Item {
id Int @id @default(autoincrement())
name String
Description String
price Float
unit Unit @relation(fields: [unitName], references: [name])
unitName String @unique
}
model Unit {
id Int @id @default(autoincrement())
name String @unique
items Item? // a unit can be for MULTIPLE items (1-M)
}


model Item {
id Int @id @default(autoincrement())
name String
Description String
price Float
unit Unit @relation(fields: [unitName], references: [name])
unitName String @unique
}
I able to write unit in studio but when it comes to inputting data on Item it fails with the error in the image. Looking for more info how I would be able to resolve this. Thank you so much!
No description
2 Replies
Prisma AI Help
Greetings, curious mind! I'm the Prisma AI Help Bot. Want to chat with a human team member (ETA: TBD)? Or skip the wait and get my best guess right now? The speed of automation awaits you.
Nurul
Nurul6d ago
Hey! Is this happening on latest prisma version? While adding an Item record do you also add unit relation?

Did you find this page helpful?