In the system, it is necessary to implement 2 types of goods, a линейка товаров (название линейки, а к ней модификации товаров из этой линейки относятся) and just обычный товар . I don’t want to do 2 separate tables for this, but simply to add the parent_id field, this is somehow not right, as when adding a product, and choosing a product line (parent), you can get ordinary products whose parent_id also 0. As for the other can this be done?
UPD: Let me give you an example: Suppose there is an HP ProBook 430 G2 product, it is a product line and it has an HP ProBook 430 G2 (P5T34ES) modification HP ProBook 430 G2 (P5T34ES) , it turns out that the HP ProBook 430 G2 parent_id wakes up parent_id is 0, and the HP ProBook 430 G2 (P5T34ES) modification HP ProBook 430 G2 (P5T34ES) , parent_id wakes equal to the id of the product line. Now imagine that there are ordinary products (which have no modification), they also wake up parent_id = 0. And now, when adding a product, when we select the product line (parent), then the list will not only HP ProBook 430 G2 , but and ordinary goods without modification
это как то не правильноWhy not? - Anatol