From 5197b332d8e315d4bcc8f96b6addfbb0567bd267 Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Wed, 17 Sep 2025 19:51:10 +0200 Subject: [PATCH] Fix jwt-token --- .../20250917-modify-drone-id-to-bigint.js | 21 +++++++++++++++++++ server/models/DroneDetection.js | 4 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 server/migrations/20250917-modify-drone-id-to-bigint.js diff --git a/server/migrations/20250917-modify-drone-id-to-bigint.js b/server/migrations/20250917-modify-drone-id-to-bigint.js new file mode 100644 index 0000000..5a809cd --- /dev/null +++ b/server/migrations/20250917-modify-drone-id-to-bigint.js @@ -0,0 +1,21 @@ +'use strict'; + +module.exports = { + up: async (queryInterface, Sequelize) => { + await queryInterface.changeColumn('drone_detections', 'drone_id', { + type: Sequelize.BIGINT, + allowNull: false, + defaultValue: 999999, + comment: 'Detected drone identifier (BIGINT for large IDs)' + }); + }, + + down: async (queryInterface, Sequelize) => { + await queryInterface.changeColumn('drone_detections', 'drone_id', { + type: Sequelize.INTEGER, + allowNull: false, + defaultValue: 999999, + comment: 'Detected drone identifier' + }); + } +}; \ No newline at end of file diff --git a/server/models/DroneDetection.js b/server/models/DroneDetection.js index eb6147e..a6b887f 100644 --- a/server/models/DroneDetection.js +++ b/server/models/DroneDetection.js @@ -17,10 +17,10 @@ module.exports = (sequelize) => { comment: 'ID of the detecting device' }, drone_id: { - type: DataTypes.INTEGER, + type: DataTypes.BIGINT, allowNull: false, defaultValue: 999999, - comment: 'Detected drone identifier' + comment: 'Detected drone identifier (BIGINT for large IDs)' }, drone_type: { type: DataTypes.INTEGER,