students are doing a Wechat mall store, because there are different goods, each commodity has different attributes, that is, the attributes are not fixed. I have considered whether it is reasonable to design in this way:
//
{
-id: ,
name:"",
descripe:"",
imgUrls:[],
details:[]
}
details put the product in different specifications, including inventory, price, and common name,descripe,imgUrls, uploaded by front-end users. Because the attribute of each uploaded item is not fixed, first let the user create attributes such as the item: color: 3, size: 3, and then js generates a list. According to the combination, 9 lists should be generated, and then the corresponding push specifications should be uploaded. Like this:
Color, size, price, stock quantity
blue 42 100 10
blue 41 110 15
.
..
then upload uniformly. Excuse me, is there any improvement in this design? I saw JD.com "s commodity with multiple attributes, which can be combined to produce more than one specification. How did JD.com design it? does details need to be divided into a separate table?