feat(customer): add migration file (#6205)

This commit is contained in:
Sebastian Rindom
2024-01-25 17:52:30 +01:00
committed by GitHub
parent e38aa29708
commit 21c1c5ce6c
5 changed files with 687 additions and 6 deletions
+2 -2
View File
@@ -25,9 +25,9 @@ export default class Address {
@ManyToOne(() => Customer, {
fieldName: "customer_id",
nullable: true,
index: "IDX_customer_address_customer_id",
})
customer?: Customer
customer: Customer
@Property({ columnType: "text", nullable: true })
company: string | null = null
@@ -32,19 +32,17 @@ export default class CustomerGroupCustomer {
entity: () => Customer,
fieldName: "customer_id",
index: "IDX_customer_group_customer_customer_id",
nullable: true,
cascade: [Cascade.REMOVE],
})
customer: Customer | null
customer: Customer
@ManyToOne({
entity: () => CustomerGroup,
fieldName: "customer_group_id",
index: "IDX_customer_group_customer_group_id",
nullable: true,
cascade: [Cascade.REMOVE],
})
customer_group: CustomerGroup | null
customer_group: CustomerGroup
@Property({ columnType: "jsonb", nullable: true })
metadata: Record<string, unknown> | null = null
+3
View File
@@ -49,6 +49,9 @@ export default class Customer {
@Property({ columnType: "text", nullable: true })
phone: string | null = null
@Property({ columnType: "boolean", default: false })
has_account: boolean = false
@Index({ name: "IDX_customer_default_shipping_address_id" })
@Property({ columnType: "text", nullable: true })
default_shipping_address_id: string | null = null