Hey everyone, sorry if this is a silly question bu...
# prisma-client
j
Hey everyone, sorry if this is a silly question but I can't figure it out from the doc. When you have an array of relations
Copy code
model House {
  id String @default(cuid()) @id
  windows: Window[]
}

model Window {
  house House @relation(fields: [houseId], references: [id])
  houseId: String
}
Is the order of the windows array meaningful? I need the user to be able to create a window in the middle of the list. I've tried to use set or connect, specifying in there an array where I've put the window in the correct place in JavaScript. It succeeds, but the order does not seem to change, the new window is added at the end. I can of course add a property index to sortBy in the cards, but that mean that whenever I reorder windows I need to update the index of many windows instead of updating one array, so I would rather avoid it. (I'm using Postgres if that's relevant) Thanks
a
I'm 99% sure the ordering in the array will be irrelevant if these are two tables in postgres. you'd need a orderBy field
I'm not sure what the behavior would be if it was a JSON field
j
fair enough
thanks