docs: document composite indices + primary key changes (#7902)
This commit is contained in:
1 parent
a84e5a6ced
commit
6cb28eedf7
13 files changed
+205
-93
No files matched your search
@@ -16,7 +16,7 @@ The rest of this guide uses this `Manager` data model as an example:
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const Manager = model.define("manager", {
|
||||
id: model.id(),
|
||||
id: model.id().primaryKey(),
|
||||
firstName: model.text(),
|
||||
lastName: model.text(),
|
||||
email: model.text(),
|
||||
|
||||
@@ -229,7 +229,7 @@ Module Relationships is coming soon.
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const Company = model.define("company", {
|
||||
id: model.id(),
|
||||
id: model.id().primaryKey(),
|
||||
name: model.text(),
|
||||
city: model.text(),
|
||||
country_code: model.text(),
|
||||
|
||||
@@ -94,7 +94,7 @@ export const restockModelHighlights = [
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const RestockNotification = model.define("restock_notification", {
|
||||
id: model.id(),
|
||||
id: model.id().primaryKey(),
|
||||
email: model.text(),
|
||||
variant_id: model.text(),
|
||||
sales_channel_id: model.text(),
|
||||
|
||||
@@ -182,7 +182,7 @@ Module Relationships is coming soon.
|
||||
import { MediaType } from "../../../types/digital-product/product-media"
|
||||
|
||||
const ProductMedia = model.define("product_media", {
|
||||
id: model.id(),
|
||||
id: model.id().primaryKey(),
|
||||
name: model.text(),
|
||||
type: model.enum(Object.values(MediaType)),
|
||||
fileKey: model.text(),
|
||||
|
||||
@@ -69,7 +69,7 @@ Module Relationships is coming soon.
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const StoreUser = model.define("store_user", {
|
||||
id: model.id(),
|
||||
id: model.id().primaryKey(),
|
||||
store_id: model.text(),
|
||||
user_id: model.text(),
|
||||
})
|
||||
@@ -87,7 +87,7 @@ Module Relationships is coming soon.
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const StoreProduct = model.define("store_user", {
|
||||
id: model.id(),
|
||||
id: model.id().primaryKey(),
|
||||
store_id: model.text(),
|
||||
product_id: model.text(),
|
||||
})
|
||||
@@ -105,7 +105,7 @@ Module Relationships is coming soon.
|
||||
import { model } from "@medusajs/utils"
|
||||
|
||||
const StoreOrder = model.define("store_user", {
|
||||
id: model.id(),
|
||||
id: model.id().primaryKey(),
|
||||
store_id: model.text(),
|
||||
order_id: model.text(),
|
||||
parent_order_id: model.text(),
|
||||
|
||||
Reference in new issue
Block a user