PrismaP
Prisma2y ago
Franco

When updating a row with compound unique all the rows are updated with the same compound

Hi all
I have the following table
model TransactionFee {
  rate Float

  validFrom DateTime @db.Date
  companyId String
  company   Company  @relation(fields: [companyId], references: [id])

  @@id([companyId, validFrom])
}


when in postgres I update any of the following
1- 2.0 2024-08-19 c8def4b5-24fd-4ead-9e41-bd5bfbb7dc11
2- 3.0 2024-08-18 c8def4b5-24fd-4ead-9e41-bd5bfbb7dc11
all the others will also be updated

for example if in 2- I change 3.0 -> 4.0, 1- will also update

am I missing something?
Was this page helpful?