Variant-axis attribute
Amulti_select attribute marked is_variant_axis is more than a descriptor.
It defines a dimension along which a product varies, such as Size or Color. When
such an attribute is created, the ProductAttribute model records the id of a native
Medusa ProductOption in its product_option_id field, and each of its
ProductAttributeValues records the matching ProductOptionValue id in
product_option_value_id.
ProductOption, the values a product
selects along that axis are exactly what Medusa uses to generate its variants.
Mirror links
The attribute catalog and Medusa’s product options are two separate modules, so the relationship is kept as a pair of read-only mirror links:
Both are 1:1 and have no pivot table. The foreign key lives on the attribute
record itself.
The mirror links are read-only. They’re resolved from the FK on the
attribute record; you never write the relationship through the link. The
workflows keep the option and the attribute in step whenever an axis attribute
or its values change.