From c38336fe9a306190f596ec23a538d19efd21268c Mon Sep 17 00:00:00 2001 From: Alexander Borg Date: Sun, 17 Aug 2025 06:05:25 +0200 Subject: [PATCH] Fix jwt-token --- server/models/Device.js | 3 ++- server/seedDatabase.js | 10 ++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/server/models/Device.js b/server/models/Device.js index f634071..28ca653 100644 --- a/server/models/Device.js +++ b/server/models/Device.js @@ -5,8 +5,9 @@ module.exports = (sequelize) => { id: { type: DataTypes.INTEGER, primaryKey: true, + autoIncrement: true, allowNull: false, - comment: 'Unique device identifier from hardware' + comment: 'Unique device identifier' }, name: { type: DataTypes.STRING, diff --git a/server/seedDatabase.js b/server/seedDatabase.js index add7d35..eba4ce8 100644 --- a/server/seedDatabase.js +++ b/server/seedDatabase.js @@ -34,16 +34,14 @@ async function seedDatabase() { const deviceCount = await Device.count(); if (deviceCount === 0) { await Device.create({ - device_id: 1001, name: 'Drone Detector Alpha', - location: 'Stockholm Central', geo_lat: 59.3293, geo_lon: 18.0686, + location_description: 'Stockholm Central', is_active: true, - detection_range: 15000, // 15km - frequency_bands: ['2.4GHz', '5.8GHz'], - device_type: 'RF_SCANNER', - last_heartbeat: new Date() + last_heartbeat: new Date(), + heartbeat_interval: 300, + firmware_version: '1.0.0' }); console.log('✅ Sample device created');