Fix jwt-token

This commit is contained in:
2025-09-17 06:02:55 +02:00
parent 83fc1098f6
commit 286c23b350
2 changed files with 43 additions and 13 deletions

View File

@@ -16,22 +16,51 @@ module.exports = (sequelize) => {
},
comment: 'ID of the device sending heartbeat'
},
tenant_id: {
type: DataTypes.UUID,
allowNull: true,
references: {
model: 'tenants',
key: 'id'
},
comment: 'Tenant ID for multi-tenancy support'
},
device_key: {
type: DataTypes.STRING,
allowNull: true, // Allow null for testing
defaultValue: 'test-device-key',
comment: 'Unique key of the sensor from heartbeat message'
},
status: {
type: DataTypes.STRING,
allowNull: true,
comment: 'Device status (online, offline, error, etc.)'
},
timestamp: {
type: DataTypes.DATE,
allowNull: true,
comment: 'Timestamp from device'
},
uptime: {
type: DataTypes.BIGINT,
allowNull: true,
comment: 'Device uptime in seconds'
},
memory_usage: {
type: DataTypes.INTEGER,
type: DataTypes.FLOAT,
allowNull: true,
comment: 'Memory usage percentage'
},
cpu_usage: {
type: DataTypes.FLOAT,
allowNull: true,
comment: 'CPU usage percentage'
},
disk_usage: {
type: DataTypes.FLOAT,
allowNull: true,
comment: 'Disk usage percentage'
},
firmware_version: {
type: DataTypes.STRING,
allowNull: true,