So I'm trying to figure out the best way to go about handling this database design wise. This is a rough idea of how I THINK it should go, but not really sure.
If I have orders that have their own necessary attributes that a user can create for all of their orders to have, and if the order can be comprised of items, and those items also can have their own custom attributes, and not necessarily the same attributes as the order, what makes the most sense?
Orders ====== id client_id Items ===== id user_id name Attributes ========== id user_id is_order_attr is_item_attr name type Orders_Attributes ================= id order_id attribute_id value Items_Attributes ================ id item_id attribute_id value
Have an Attributes table for Orders and an Attributes table for Items, subsequently storing the values in another table, say Orders_Attributes_Values and Items_Attributes_Values?
Storing everything in a JSON Data Type column in some type of Orders_Configs table and then storing the values in additional tables with the JSON Data Type?
Something completely different?
Attributestable joined to two separate tables. It seems to be redundand. Or use it as a template storage while creating a record in
????_Attributetable and do not attach to any table in DB schema.