fix(log): F6 polish — log datasource create error log + schema patches for auth_type/token/headers + ES default index sync on datasource select
This commit is contained in:
1 parent
6bba6144f3
commit
5fb74a787a
3 files changed
+17
-6
No files matched your search
@@ -192,4 +192,16 @@ func applySchemaPatches(db *gorm.DB) {
|
||||
patchUserColumn("ApiAccessKeyDescription", "api_access_key_description")
|
||||
patchUserColumn("ApiAccessKeyDurationMonths", "api_access_key_duration_months")
|
||||
patchUserColumn("ApiAccessKeyLastUsedAt", "api_access_key_last_used_at")
|
||||
|
||||
// 补全日志数据源表可能缺失的列(旧表仅有基础字段)// Logan.Li
|
||||
patchLogDSColumn := func(field string, col string) {
|
||||
if !m.HasColumn(&model.LogDataSource{}, col) {
|
||||
if err := m.AddColumn(&model.LogDataSource{}, field); err != nil {
|
||||
log.Printf("[DB] 补列 monitor_log_datasources.%s 失败: %v", col, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
patchLogDSColumn("AuthType", "auth_type")
|
||||
patchLogDSColumn("Token", "token")
|
||||
patchLogDSColumn("Headers", "headers")
|
||||
}
|
||||
Reference in new issue
Block a user