feat(cart): Migration file (#6156)
* feat(cart): Migration file * fixup migration * Add indexes on cart table for currency, region, and sales channel * fix indexes * address PR comments
This commit is contained in:
@@ -16,7 +16,10 @@ export default abstract class AdjustmentLine {
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
description: string | null = null
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
@Property({
|
||||
columnType: "text",
|
||||
nullable: true,
|
||||
})
|
||||
promotion_id: string | null = null
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
OneToMany,
|
||||
OptionalProps,
|
||||
PrimaryKey,
|
||||
Property
|
||||
Property,
|
||||
} from "@mikro-orm/core"
|
||||
import Address from "./address"
|
||||
import LineItem from "./line-item"
|
||||
@@ -29,7 +29,11 @@ export default class Cart {
|
||||
@PrimaryKey({ columnType: "text" })
|
||||
id: string
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
@Property({
|
||||
columnType: "text",
|
||||
nullable: true,
|
||||
index: "IDX_cart_region_id",
|
||||
})
|
||||
region_id?: string | null
|
||||
|
||||
@Property({
|
||||
@@ -39,13 +43,17 @@ export default class Cart {
|
||||
})
|
||||
customer_id?: string | null
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
@Property({
|
||||
columnType: "text",
|
||||
nullable: true,
|
||||
index: "IDX_cart_sales_channel_id",
|
||||
})
|
||||
sales_channel_id?: string | null
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
email?: string | null
|
||||
|
||||
@Property({ columnType: "text" })
|
||||
@Property({ columnType: "text", index: "IDX_cart_curency_code" })
|
||||
currency_code: string
|
||||
|
||||
@Index({ name: "IDX_cart_shipping_address_id" })
|
||||
|
||||
@@ -61,7 +61,11 @@ export default class LineItem {
|
||||
})
|
||||
variant_id?: string | null
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
@Property({
|
||||
columnType: "text",
|
||||
nullable: true,
|
||||
index: "IDX_line_item_product_id",
|
||||
})
|
||||
product_id?: string | null
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
|
||||
@@ -43,7 +43,11 @@ export default class ShippingMethod {
|
||||
@Property({ columnType: "boolean" })
|
||||
is_tax_inclusive = false
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
@Property({
|
||||
columnType: "text",
|
||||
nullable: true,
|
||||
index: "IDX_shipping_method_option_id",
|
||||
})
|
||||
shipping_option_id?: string | null
|
||||
|
||||
@Property({ columnType: "jsonb", nullable: true })
|
||||
|
||||
@@ -11,7 +11,10 @@ export default abstract class TaxLine {
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
description?: string | null
|
||||
|
||||
@Property({ columnType: "text", nullable: true })
|
||||
@Property({
|
||||
columnType: "text",
|
||||
nullable: true,
|
||||
})
|
||||
tax_rate_id?: string | null
|
||||
|
||||
@Property({ columnType: "text" })
|
||||
|
||||
Reference in New Issue
Block a user