From db75431fe7a401ac3509bf41c2f9c405bb07a408 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 13 六月 2024 20:17:00 +0800 Subject: [PATCH] add field define --- models/attribute_value.go | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/models/attribute_value.go b/models/attribute_value.go index 3b8ad53..f6bca8b 100644 --- a/models/attribute_value.go +++ b/models/attribute_value.go @@ -10,9 +10,9 @@ // AttributeValue 灞炴�у�煎拰瀵硅薄 AttributeValue struct { gorm.Model - EntityID string `gorm:"primaryKey"` - AttributeID uint `gorm:"primaryKey"` - Value string `json:"value"` + EntityID string `gorm:"uniqueIndex:entity_id_attr_id;type:varchar(100);not null;default:''" json:"entityID"` + AttributeID uint `gorm:"uniqueIndex:entity_id_attr_id;type:int;not null;default:0" json:"attributeID"` + Value string `gorm:"type:varchar(255);not null;default:''" json:"value"` } AttributeValueSearch struct { -- Gitblit v1.8.0