php - DataBase Data interity with four tables -


i have 4 tables (products, brands, colors , colorproducts) - product has 1 brand - color has 1 brand - colorproduct has 1 product , 1 color

the problem see colorproduct references color , product , both of them reference brand. happens if product , color referenced same colorproduct reference 2 different brands?

i suppose database bad don't know how fix it. use doctrine 2 orm , have read in documentation use of composite primary keys should avoided if possible. see solution problem?

thank you

it seems me brand having color unnecessary.

it gives 2 choices, store brand in product, or store brand colorproduct.

i think make sense store brand in product , solve issue altogether, color entirely irrelevant brand, associating brand colorproduct doesn't make sense.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -