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,