Let's say i have a webshop, and i would like to sell 2 different types of products, flowers and furniture for example. How should i structure the models/the database to be able to have different attributes for the two product types. Flowers would for instance
have attributes like flower size, flower period and pot size and so on. And the furniture would have attributes for material, height, length and width and so on.
Should i create one model that includes all attributes and let the ones which are not needed be null or is there a better way? In my real life project i have about 800 products split between two product types. In this example that would be 400 flowers and 400 furnitures. Other solutions I've thought about are having a table for attributes and then another table with many to many relationship to link the products with the attributes. I've also thought about whether or not it is possible to create one model including all the general product information and then create "sub models" that includes the extra attributes and inherits the rest from the product model. One sub model for flowers and one sub model for furniture in this example. Helping me understand which solution is the best and quickest would be much appreciated. Thank you.
Should i create one model that includes all attributes and let the ones which are not needed be null or is there a better way? In my real life project i have about 800 products split between two product types. In this example that would be 400 flowers and 400 furnitures. Other solutions I've thought about are having a table for attributes and then another table with many to many relationship to link the products with the attributes. I've also thought about whether or not it is possible to create one model including all the general product information and then create "sub models" that includes the extra attributes and inherits the rest from the product model. One sub model for flowers and one sub model for furniture in this example. Helping me understand which solution is the best and quickest would be much appreciated. Thank you.