I'm creating a webapp that has a variety of models: Product, Category, ProductOption, etc.
All of these models have a set of shared attributes: name, description, image, etc.
There are two options I see: 1. adding all of these attributes as columns to each of the model's table. 2. create a separate meta table that contains these columns with a polymorphic relationship between a model and the meta.
products id ... name description image product_categories id ... name description image
products id ... product_categories id ... metas id name description image metaable_id // foreign key metaable_type // model type (Product, ProductCategory)
Is there a clear decision here? Am I missing any alternatives? Thanks.