Capture edges from traceroutes

This commit is contained in:
Anton Roslund 2026-01-06 16:39:39 +01:00
parent 3cfb7e7dff
commit 57dce4f099
4 changed files with 141 additions and 1 deletions

View file

@ -0,0 +1,23 @@
-- CreateTable
CREATE TABLE `edges` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`from_node_id` BIGINT NOT NULL,
`to_node_id` BIGINT NOT NULL,
`snr` INTEGER NOT NULL,
`from_latitude` INTEGER NULL,
`from_longitude` INTEGER NULL,
`to_latitude` INTEGER NULL,
`to_longitude` INTEGER NULL,
`packet_id` BIGINT NOT NULL,
`channel_id` VARCHAR(191) NULL,
`gateway_id` BIGINT NULL,
`source` VARCHAR(191) NOT NULL,
`created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`updated_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
INDEX `edges_from_node_id_idx`(`from_node_id`),
INDEX `edges_to_node_id_idx`(`to_node_id`),
INDEX `edges_created_at_idx`(`created_at`),
INDEX `edges_from_node_id_to_node_id_idx`(`from_node_id`, `to_node_id`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

View file

@ -347,4 +347,28 @@ model ChannelUtilizationStats {
@@index([channel_id])
@@index([recorded_at])
@@map("channel_utilization_stats")
}
model Edge {
id BigInt @id @default(autoincrement())
from_node_id BigInt
to_node_id BigInt
snr Int
from_latitude Int?
from_longitude Int?
to_latitude Int?
to_longitude Int?
packet_id BigInt
channel_id String?
gateway_id BigInt?
source String
created_at DateTime @default(now())
updated_at DateTime @default(now()) @updatedAt
@@index(from_node_id)
@@index(to_node_id)
@@index(created_at)
@@index([from_node_id, to_node_id])
@@map("edges")
}