Hi guys, I am using Prisma in one of my applicatio...
# orm-help
m
Hi guys, I am using Prisma in one of my applications, but I have a problem I cant figure out. The application is a webshop, but I cant figure out how to let a user buy a single product multiple times. Can someone help me? Here is my model so far:
Copy code
model Product {
  id          Int      @id @default(autoincrement())
  createdAt   DateTime @default(now())
  updatedAt   DateTime @updatedAt
  name        String   @unique @db.VarChar(255)
  description String?
  price       Float
  published   Boolean  @default(true)
  // een relatie van alle orders met dit product erin
  orders      Order[]
}

model Order {
  id         Int       @id @default(autoincrement())
  clientName String
  email      String
  placedAt   DateTime  @default(now())
  status     Status    @default(PLACED)
  Products   Product[]
}
Nvm i figured it out
1