Product for category: many-to-many
Product For Subcategory: One To One
Subcategory: Multi-to-One
This makes no sense. If the product and subcategory are the same, then they are one and the same object. Or are they equal to 0/1?
In any case, in any case, if they are from one to one or from one to zero or one, then each product belongs to another subcategory, and each subcategory has no more than one product assigned to it. If so, then it may not be that the products are one for many, and the categories and subcategories are the same for many with the category.
Think about it. If a can be many categories for one Product, but only one subcategory for a Product, then there can be many categories for a subcategory, which is the opposite of what you have for both categories and subcategories: from one to many
Typically, relationships for product categories and subcategories are as follows:
Category for subcategory from one to many (many subcategories for each category - only one category for each subcategory)
Product Subcategory: From one to many, many products may be in each subcategory. but each product is in no more than one subcategory.
Are you sure this is not your structure? ...
source share