Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on The surprisingly difficult problem of user-defined order in SQL.
ItemsOrderConfiguration Table
Id | Json (varchar(MAX) or proper JSON type in Relational DBs)
1 | [
{ "ItemId": 1, "Order": 2 }, { "ItemId": 2, "Order": 1 }, ]
{ "ItemId": 15, "Order": 1 }, { "ItemId": 32, "Order": 2 }, ]
ItemsOrderConfiguration Table
Id | Json (varchar(MAX) or proper JSON type in Relational DBs)
1 | [
2 | [ the bad thing about this is that you lose constrains e.g that ItemId actually exists, but it shouldn't be a problem.