docs: add note about default owner table in many-to-many (#10426)
This commit is contained in:
@@ -179,6 +179,12 @@ The `pivotTable`, `joinColumn`, and `inverseJoinColumn` property are only availa
|
||||
|
||||
</Note>
|
||||
|
||||
<Note>
|
||||
|
||||
Following [Medusa v2.1.0](https://github.com/medusajs/medusa/releases/tag/v2.1.0), if `pivotTable`, `joinColumn`, and `inverseJoinColumn` aren't specified on either models, the owner is decided based on alphabetical order. So, in the example above, the `Order` data model would be the owner.
|
||||
|
||||
</Note>
|
||||
|
||||
In this example, an order is associated with many products, and a product is associated with many orders. Since the `pivotTable`, `joinColumn`, and `inverseJoinColumn` configurations are defined on the order, it's considered the owner data model.
|
||||
|
||||
### Many-to-Many Relationship in the Database
|
||||
|
||||
Reference in New Issue
Block a user