I am trying to avoid anti-pattern in project where I must allow users to create, modify and delete table fields. So I am looking for storing JSON data in table. For example I have table products:
Products
----------------
id,
user_id,
created,
modified,
price,
_custom <-- there will be stored additional columns for each product needs
{"adjustment":0.13, "weight":14.60, "have_some_individual_label":"value"}
But I can't see how it is possible to include _column parameters in query. For example, how to query all products where user_id = 1 AND have_some_individual_label = value. Second parameter can be one, ore more (it will be used for filters and analytic). If this is bad approach - what would be better one? Thanks!