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
|
||||
|
||||
@@ -45,7 +45,7 @@ export const generatedEditDates = {
|
||||
"app/learn/advanced-development/data-models/manage-relationships/page.mdx": "2024-09-10T11:39:51.167Z",
|
||||
"app/learn/advanced-development/modules/remote-query/page.mdx": "2024-07-21T21:20:24+02:00",
|
||||
"app/learn/advanced-development/modules/options/page.mdx": "2024-10-16T08:49:27.162Z",
|
||||
"app/learn/advanced-development/data-models/relationships/page.mdx": "2024-11-27T16:05:55.995Z",
|
||||
"app/learn/advanced-development/data-models/relationships/page.mdx": "2024-12-04T10:52:32.992Z",
|
||||
"app/learn/advanced-development/workflows/compensation-function/page.mdx": "2024-11-28T14:05:29.691Z",
|
||||
"app/learn/advanced-development/modules/service-factory/page.mdx": "2024-09-30T08:43:53.127Z",
|
||||
"app/learn/advanced-development/data-models/primary-key/page.mdx": "2024-09-30T08:43:53.123Z",
|
||||
|
||||
Reference in New Issue
Block a user