mirror of
https://github.com/Roslund/meshtastic-map.git
synced 2026-03-28 17:43:03 +01:00
Add Battery and ChannelUtilization tables
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE `battery_stats` (
|
||||
`id` BIGINT NOT NULL AUTO_INCREMENT,
|
||||
`recorded_at` DATETIME(3) NULL DEFAULT CURRENT_TIMESTAMP(3),
|
||||
`avg_battery_level` DECIMAL(5, 2) NULL,
|
||||
|
||||
INDEX `battery_stats_recorded_at_idx`(`recorded_at`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE `channel_utilization_stats` (
|
||||
`id` BIGINT NOT NULL AUTO_INCREMENT,
|
||||
`recorded_at` DATETIME(3) NULL DEFAULT CURRENT_TIMESTAMP(3),
|
||||
`avg_channel_utilization` DECIMAL(65, 30) NULL,
|
||||
|
||||
INDEX `channel_utilization_stats_recorded_at_idx`(`recorded_at`),
|
||||
PRIMARY KEY (`id`)
|
||||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
@@ -301,3 +301,21 @@ model Waypoint {
|
||||
@@index(gateway_id)
|
||||
@@map("waypoints")
|
||||
}
|
||||
|
||||
model BatteryStats {
|
||||
id BigInt @id @default(autoincrement())
|
||||
recorded_at DateTime? @default(now())
|
||||
avg_battery_level Decimal? @db.Decimal(5, 2)
|
||||
|
||||
@@index([recorded_at])
|
||||
@@map("battery_stats")
|
||||
}
|
||||
|
||||
model ChannelUtilizationStats {
|
||||
id BigInt @id @default(autoincrement())
|
||||
recorded_at DateTime? @default(now())
|
||||
avg_channel_utilization Decimal?
|
||||
|
||||
@@index([recorded_at])
|
||||
@@map("channel_utilization_stats")
|
||||
}
|
||||
Reference in New Issue
Block a user