fix: Use integer for variant and category ranks (#7572)

This commit is contained in:
Stevche Radevski
2024-06-01 16:25:04 +02:00
committed by GitHub
parent 97327670a5
commit 3ede9d7863
6 changed files with 68 additions and 43 deletions
@@ -68,7 +68,11 @@ class ProductCategory {
@Property({ columnType: "boolean", default: false })
is_internal?: boolean
@Property({ columnType: "numeric", nullable: false, default: 0 })
@Property({
columnType: "integer",
nullable: false,
default: 0,
})
rank?: number
@ManyToOne(() => ProductCategory, {
@@ -130,12 +130,10 @@ class ProductVariant {
@Property({ columnType: "jsonb", nullable: true })
metadata?: Record<string, unknown> | null
// TODO: replace with BigNumber, or in this case a normal int should work
@Property({
columnType: "numeric",
columnType: "integer",
nullable: true,
default: 0,
serializer: optionalNumericSerializer,
})
variant_rank?: number | null