collect waypoints

This commit is contained in:
liamcottle
2024-03-15 16:11:51 +13:00
parent 8cda474f13
commit bb7fa83d94
3 changed files with 99 additions and 0 deletions

View File

@ -0,0 +1,28 @@
-- CreateTable
CREATE TABLE `waypoints` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`from` BIGINT NOT NULL,
`to` BIGINT NOT NULL,
`waypoint_id` BIGINT NOT NULL,
`latitude` INTEGER NOT NULL,
`longitude` INTEGER NOT NULL,
`expire` BIGINT NULL,
`locked_to` BIGINT NULL,
`name` VARCHAR(191) NULL,
`description` VARCHAR(191) NULL,
`icon` INTEGER NULL,
`channel` INTEGER NOT NULL,
`packet_id` BIGINT NOT NULL,
`channel_id` VARCHAR(191) NOT NULL,
`gateway_id` BIGINT NULL,
`created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`updated_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
INDEX `waypoints_created_at_idx`(`created_at`),
INDEX `waypoints_updated_at_idx`(`updated_at`),
INDEX `waypoints_from_idx`(`from`),
INDEX `waypoints_waypoint_id_idx`(`waypoint_id`),
INDEX `waypoints_packet_id_idx`(`packet_id`),
INDEX `waypoints_gateway_id_idx`(`gateway_id`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

View File

@ -141,3 +141,34 @@ model TraceRoute {
@@index(node_id)
@@map("traceroutes")
}
model Waypoint {
id BigInt @id @default(autoincrement())
from BigInt
to BigInt
waypoint_id BigInt
latitude Int
longitude Int
expire BigInt?
locked_to BigInt?
name String?
description String?
icon Int?
channel Int
packet_id BigInt
channel_id String
gateway_id BigInt?
created_at DateTime @default(now())
updated_at DateTime @default(now()) @updatedAt
@@index(created_at)
@@index(updated_at)
@@index(to)
@@index(from)
@@index(waypoint_id)
@@index(packet_id)
@@index(gateway_id)
@@map("waypoints")
}