logoalt Hacker News

jayanmnyesterday at 3:48 AM1 replyview on HN

Property1 to 20 or more is an example. There are better ways to do it but I have seen columns for storing ‘anything’


Replies

Spivakyesterday at 5:19 AM

Sounds like a generic form of single table inheritance. I don't honestly see any other way to do it (punting to a JSON field is effectively the same thing) when you have potentially thousands of parts all with their own super specific relevant attributes.

I've worked on multiple products that have had a concept of "custom fields" who did it this way too.