refactor(entity): Update unique index priorities for product entity fields
This commit is contained in:
parent
bf6271c3dc
commit
e632f71329
|
|
@ -7,8 +7,8 @@ import (
|
|||
type MProductEntity struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;default:uuid_generate_v4()" json:"id"`
|
||||
Name string `gorm:"type:varchar(255);not null" json:"name"`
|
||||
RefNumber string `gorm:"type:varchar(100);not null;uniqueIndex:idx_product_refnumber_client" json:"ref_number"`
|
||||
SKU string `gorm:"type:varchar(100);not null;uniqueIndex:idx_product_sku_client" json:"sku"`
|
||||
RefNumber string `gorm:"type:varchar(100);not null;uniqueIndex:idx_product_refnumber_client,priority:1" json:"ref_number"`
|
||||
SKU string `gorm:"type:varchar(100);not null;uniqueIndex:idx_product_sku_client,priority:1" json:"sku"`
|
||||
Description string `gorm:"type:text" json:"description"`
|
||||
Status string `gorm:"type:varchar(50);not null" json:"status"`
|
||||
IsReturnable bool `gorm:"type:boolean;default:false" json:"is_returnable"`
|
||||
|
|
@ -29,7 +29,7 @@ type MProductEntity struct {
|
|||
MultiplyRate string `gorm:"type:varchar(50)" json:"multiply_rate"`
|
||||
DivideRate float64 `gorm:"type:decimal(10,2)" json:"divide_rate"`
|
||||
|
||||
ClientID uuid.UUID `gorm:"type:uuid;index;uniqueIndex:idx_product_refnumber_client,uniqueIndex:idx_product_sku_client" json:"client_id"`
|
||||
ClientID uuid.UUID `gorm:"type:uuid;index;uniqueIndex:idx_product_refnumber_client,priority:2;uniqueIndex:idx_product_sku_client,priority:2" json:"client_id"`
|
||||
CategoryID uuid.UUID `gorm:"type:uuid;index" json:"category_id"`
|
||||
UomID uuid.UUID `gorm:"type:uuid;index" json:"uom_id"`
|
||||
DimUomID uuid.UUID `gorm:"type:uuid;index" json:"dim_uom_id"`
|
||||
|
|
|
|||
Loading…
Reference in New Issue