fix(config): 统一历史记录与配置的数据库时间来源
- saveHistory 接收调用方传入的数据库时间,不再使用 time.Now() - 更新、删除、回滚先取 dao.Now(),避免取时间失败时产生无效历史 - 历史表 created_at 升级为 datetime(3),新增迁移脚本
This commit is contained in:
@@ -39,7 +39,7 @@ type AppConfigHistory struct {
|
||||
Operate string `xorm:"varchar(16)" json:"operate"` // update, delete, rollback
|
||||
Contents string `xorm:"text" json:"contents"`
|
||||
ActiveContents string `xorm:"-" json:"activeContents,omitempty"`
|
||||
CreatedAt *time.Time `xorm:"datetime" json:"createdAt"`
|
||||
CreatedAt *time.Time `xorm:"datetime(3)" json:"createdAt"`
|
||||
CreatedBy string `xorm:"varchar(32)" json:"createdBy"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user