Johan LAJILI
05/11/2022, 4:06 PMmodel 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)
ThanksAustin Zentz
05/11/2022, 4:16 PMAustin Zentz
05/11/2022, 4:16 PMJohan LAJILI
05/11/2022, 4:17 PMJohan LAJILI
05/11/2022, 4:17 PMJohan LAJILI
05/13/2022, 8:56 AM