3 ms·
yolo hack - this way we only update 1 row, but when obtaining items, then we have to join/load entry from this table too ItemsOrderConfiguration Table Id | Js
by tester756 6y ago
yolo hack - this way we only update 1 row, but when obtaining items, then we have to join/load entry from this table too
ItemsOrderConfiguration Table
Id | Json (varchar(MAX) or proper JSON type in Relational DBs)
1 | [
{
"ItemId": 1,
"Order": 2
},
{
"ItemId": 2,
"Order": 1
},
]
2 | [
{
"ItemId": 15,
"Order": 1
},
{
"ItemId": 32,
"Order": 2
},
]
the bad thing about this is that you lose constrains e.g that ItemId actually exists, but it shouldn't be a problem.
- earthboundkid 6y agoPostgres has an array type, so you can just make an array of IDs.