I am creating a custom blog, shop and services area for a customer.
What is the most efficient way to structure a 'category' for each of these.
I was thinking of designing the relational database like so. Here are the names of the tables.
Articles
articles
article_cateogriesProducts
products
product_cateogriesServices
services
service_categories
OR
Articles
articlesProducts
productsServices
servicesCategories
categories
Columns: (id, name, product_id, article_id, service_id)
Where type is a product, service, or category
The second solution I'd be able to have one category and use it for articles, services and products. I need something scale-able and doing a category for each of the above doesn't make sense and would be a nightmare.
I just don't want a whole bunch of null-able ID fields.
If anyone has any scale-able solutions, let me know! Thanks!
Aucun commentaire:
Enregistrer un commentaire