From 1ed5edad0cf2a0191b2b73d851adbf9cacdae0c0 Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Mon, 22 Sep 2025 05:56:12 +0200 Subject: [PATCH] Fix jwt-token --- .../20250820000001-create-initial-tables.js | 78 ++++++++++++++++++- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a/server/migrations/20250820000001-create-initial-tables.js b/server/migrations/20250820000001-create-initial-tables.js index 0043a5a..2a743fe 100644 --- a/server/migrations/20250820000001-create-initial-tables.js +++ b/server/migrations/20250820000001-create-initial-tables.js @@ -511,10 +511,82 @@ module.exports = { type: Sequelize.JSON, allowNull: false }, - cooldown_minutes: { - type: Sequelize.INTEGER, - defaultValue: 5 + device_ids: { + type: Sequelize.JSON, + allowNull: true, + comment: 'Array of device IDs to monitor (null = all devices)' }, + drone_types: { + type: Sequelize.JSON, + allowNull: true, + comment: 'Array of drone types to alert on (null = all types)' + }, + min_rssi: { + type: Sequelize.INTEGER, + allowNull: true, + comment: 'Minimum RSSI threshold for alert' + }, + max_rssi: { + type: Sequelize.INTEGER, + allowNull: true, + comment: 'Maximum RSSI threshold for alert' + }, + frequency_ranges: { + type: Sequelize.JSON, + allowNull: true, + comment: 'Array of frequency ranges to monitor [{min: 20, max: 30}]' + }, + time_window: { + type: Sequelize.INTEGER, + defaultValue: 300, + comment: 'Time window in seconds to group detections' + }, + min_detections: { + type: Sequelize.INTEGER, + defaultValue: 1, + comment: 'Minimum number of detections in time window to trigger alert' + }, + cooldown_period: { + type: Sequelize.INTEGER, + defaultValue: 600, + comment: 'Cooldown period in seconds between alerts for same drone' + }, + alert_channels: { + type: Sequelize.JSON, + defaultValue: ['sms'], + comment: 'Array of alert channels: sms, email, webhook' + }, + sms_phone_number: { + type: Sequelize.STRING, + allowNull: true, + comment: 'Phone number for SMS alerts' + }, + webhook_url: { + type: Sequelize.STRING, + allowNull: true, + comment: 'Webhook URL for custom integrations' + }, + active_hours: { + type: Sequelize.JSON, + allowNull: true, + comment: 'Active hours for alerts {start: "09:00", end: "17:00"}' + }, + active_days: { + type: Sequelize.JSON, + defaultValue: [1, 2, 3, 4, 5, 6, 7], + comment: 'Active days of week (1=Monday, 7=Sunday)' + }, + priority: { + type: Sequelize.ENUM('low', 'medium', 'high', 'critical'), + defaultValue: 'medium', + comment: 'Alert priority level' + }, + min_threat_level: { + type: Sequelize.ENUM('monitoring', 'low', 'medium', 'high', 'critical'), + allowNull: true, + comment: 'Minimum threat level required to trigger alert' + }, + is_active: { type: Sequelize.BOOLEAN, defaultValue: true