feat(heartbeat): 添加版本号字段并处理亮度值-1为NULL
- 在心跳事件表中新增 version 字段,用于存储版本号信息 - 将 bright_g 字段的 -1 值映射为数据库中的 NULL,避免语义混淆 - 更新相关文档、数据库迁移脚本和测试用例
This commit is contained in:
@@ -420,6 +420,7 @@ class DatabaseManager {
|
||||
'comm_seq',
|
||||
'insert_card',
|
||||
'bright_g',
|
||||
'version',
|
||||
'elec_address',
|
||||
'air_address',
|
||||
'voltage',
|
||||
@@ -453,7 +454,8 @@ class DatabaseManager {
|
||||
e.device_count,
|
||||
e.comm_seq,
|
||||
e.insert_card ?? null,
|
||||
e.bright_g ?? null,
|
||||
(e.bright_g === -1 || e.bright_g === '-1') ? null : (e.bright_g ?? null),
|
||||
e.version ?? null,
|
||||
Array.isArray(e.elec_address) ? e.elec_address : null,
|
||||
Array.isArray(e.air_address) ? e.air_address : null,
|
||||
Array.isArray(e.voltage) ? e.voltage : null,
|
||||
|
||||
Reference in New Issue
Block a user