diff --git a/prisma/migrations/20250415153323_add_portnum_to_service_envelopes/migration.sql b/prisma/migrations/20250415153323_add_portnum_to_service_envelopes/migration.sql new file mode 100644 index 0000000..20c56fe --- /dev/null +++ b/prisma/migrations/20250415153323_add_portnum_to_service_envelopes/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE `service_envelopes` ADD COLUMN `portnum` INTEGER NULL; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index a4d10d6..660afbb 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -204,6 +204,7 @@ model ServiceEnvelope { gateway_id BigInt? to BigInt from BigInt + portnum Int? protobuf Bytes created_at DateTime @default(now()) diff --git a/src/mqtt.js b/src/mqtt.js index 702f240..2e2b502 100644 --- a/src/mqtt.js +++ b/src/mqtt.js @@ -750,6 +750,7 @@ client.on("message", async (topic, message) => { gateway_id: envelope.gatewayId ? convertHexIdToNumericId(envelope.gatewayId) : null, to: envelope.packet.to, from: envelope.packet.from, + portnum: portnum, protobuf: message, }, });