track when node position was last updated
This commit is contained in:
parent
d3ac6bf014
commit
020c78ac85
3 changed files with 7 additions and 3 deletions
|
|
@ -0,0 +1,2 @@
|
|||
-- AlterTable
|
||||
ALTER TABLE `nodes` ADD COLUMN `position_updated_at` DATETIME(3) NULL;
|
||||
|
|
@ -22,9 +22,10 @@ model Node {
|
|||
is_licensed Boolean
|
||||
role Int
|
||||
|
||||
latitude Int?
|
||||
longitude Int?
|
||||
altitude Int?
|
||||
latitude Int?
|
||||
longitude Int?
|
||||
altitude Int?
|
||||
position_updated_at DateTime?
|
||||
|
||||
battery_level Int?
|
||||
voltage Decimal?
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ client.on("message", async (topic, message) => {
|
|||
node_id: envelope.packet.from,
|
||||
},
|
||||
data: {
|
||||
position_updated_at: new Date(),
|
||||
latitude: position.latitudeI,
|
||||
longitude: position.longitudeI,
|
||||
altitude: position.altitude !== 0 ? position.altitude : null,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue