php - MYSQL Laravel Product Variations structure

one text

Solution:

I would use a Json column for 'variations' with the following structure:

[
  [ 'attribute_id' => 1, 'attribute_name_id' => 1],
  [ 'attribute_id' => 2, 'attribute_name_id' => 2],
  [ 'attribute_id' => 3, 'attribute_name_id' => 3],
]

This way you can easily access the list of those attributes and it is extremely flexible in case you would need to add other fields to the varitions.

Source