-
Notifications
You must be signed in to change notification settings - Fork 1
/
history.go
13 lines (11 loc) · 1018 Bytes
/
history.go
1
2
3
4
5
6
7
8
9
10
11
12
13
package entity
import "gorm.io/gorm"
type History struct {
gorm.Model
Entity string `gorm:"type:varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL;index:att_histories_entity_idx"` // the name (type) of the entity
EntityId string `gorm:"type:varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL;index:att_histories_entity_idx"` // the pk of the entity
Operation string `gorm:"type:varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL"` // update / delete / undelete
RequestId string `gorm:"type:varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"` // optional request id that triggered the change
Identity string `gorm:"type:varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;NOT NULL;index:att_histories_identity_idx"` // the subject that triggered the change
Diff string `gorm:"type:text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci"`
}